Project

General

Profile

« Previous | Next » 

Revision d433b50e

Added by Leszek Koltunski over 2 years ago

In the 'magic' app, ObjectType is now only used in RubikObject and RubikObjectList classes and nowhere else.
This is a major step towards being able to download objects from an online repository.

View differences:

src/main/java/org/distorted/objects/RubikObject.java
19 19

  
20 20
package org.distorted.objects;
21 21

  
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23

  
24 22
import org.distorted.dmesh.ObjectMesh;
25 23
import org.distorted.jsons.ObjectJson;
26 24
import org.distorted.objectlib.main.ObjectType;
27 25
import org.distorted.patterns.RubikPatternList;
28 26

  
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28

  
29 29
public class RubikObject
30 30
{
31 31
  private static final int NUM = 4;
......
39 39

  
40 40
///////////////////////////////////////////////////////////////////////////////////////////////////
41 41

  
42
  RubikObject(int ordinal, ObjectType type)
42
  RubikObject(ObjectType type)
43 43
    {
44 44
    mIconID = new int[NUM];
45 45
    for(int i=0; i<NUM; i++) mIconID[i] = type.getIconID(i);
46 46

  
47 47
    mName        = type.name();
48 48
    mNumScramble = type.getNumScramble();
49
    mOrdinal     = ordinal;
50
    mJsonID      = ObjectJson.getJsonID(type);
51
    mMeshID      = ObjectMesh.getMeshID(type);
49
    mOrdinal     = type.ordinal();
50
    mJsonID      = ObjectJson.getJsonID(mOrdinal);
51
    mMeshID      = ObjectMesh.getMeshID(mOrdinal);
52 52

  
53
    int patternOrdinal  = RubikPatternList.getOrdinal(type);
53
    int patternOrdinal  = RubikPatternList.getOrdinal(mOrdinal);
54 54
    mPatterns = RubikPatternList.getPatterns(patternOrdinal);
55 55
    }
56 56

  

Also available in: Unified diff