Project

General

Profile

Download (4.1 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / metadata / Metadata.java @ ade99032

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2023 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.metadata;
11

    
12
import org.distorted.objectlib.R;
13
import org.distorted.objectlib.main.TwistyObject;
14
import org.distorted.objectlib.signature.ObjectSignature;
15

    
16
///////////////////////////////////////////////////////////////////////////////////////////////////
17

    
18
public class Metadata
19
  {
20
  public static final int CATEGORY_SHAPE_TET    = 0;       // least-sig 3 bits of the Category
21
  public static final int CATEGORY_SHAPE_HEX    = 1;
22
  public static final int CATEGORY_SHAPE_OCT    = 2;
23
  public static final int CATEGORY_SHAPE_DOD    = 3;
24
  public static final int CATEGORY_SHAPE_ICO    = 4;
25
  public static final int CATEGORY_SHAPE_BAL    = 5;
26
  public static final int CATEGORY_SHAPE_OTH    = 6;
27

    
28
  public static final int CATEGORY_AXIS_FACE    = (0<<3);  // next 2 bits
29
  public static final int CATEGORY_AXIS_EDGE    = (1<<3);
30
  public static final int CATEGORY_AXIS_CORN    = (2<<3);
31
  public static final int CATEGORY_AXIS_OTHE    = (3<<3);
32

    
33
  public static final int CATEGORY_GHOST        = (1<<5);  // from now on, individual bits
34
  public static final int CATEGORY_MIRROR       = (1<<6);
35
  public static final int CATEGORY_CUBOID       = (1<<7);
36
  public static final int CATEGORY_SHAPEMOD_3x3 = (1<<8);
37
  public static final int CATEGORY_SHAPEMOD_SKE = (1<<9);
38
  public static final int CATEGORY_MIXUP        = (1<<10);
39
  public static final int CATEGORY_COIN         = (1<<11);
40
  public static final int CATEGORY_CRAZY        = (1<<12);
41
  public static final int CATEGORY_SQUARE       = (1<<13);
42
  public static final int CATEGORY_BANDAGED     = (1<<14);
43
  public static final int CATEGORY_VOID         = (1<<15);
44

    
45
  private final int[] mNumLayers;
46
  private final int mParam;
47
  private final float[][] mPos;
48
  private final Class<? extends TwistyObject> mClass;
49
  private final ObjectSignature mSignature;
50

    
51
///////////////////////////////////////////////////////////////////////////////////////////////////
52

    
53
  public Metadata(Class<? extends TwistyObject> clazz, int[] layers, int param, float[][] pos, int objConstant)
54
    {
55
    mNumLayers = layers;
56
    mParam     = param;
57
    mPos       = pos;
58
    mClass     = clazz;
59
    mSignature =  new ObjectSignature(objConstant);
60
    }
61

    
62
///////////////////////////////////////////////////////////////////////////////////////////////////
63

    
64
  public int numScrambles()       { return 1; }
65
  public int icon()               { return R.drawable.cube_3; }
66
  public boolean getActive()      { return true; }
67
  public int price()              { return 0; }
68
  public int objectVersion()      { return 1; }
69
  public int extrasVersion()      { return 1; }
70
  public int[] getNumLayers()     { return mNumLayers; }
71
  public int getParam()           { return mParam; }
72
  public float[][] getPos()       { return mPos; }
73
  public int extrasJson()         { return 0; }
74
  public int objectJson()         { return 0; }
75
  public int mesh()               { return 0; }
76
  public String getAuthor()       { return null; }
77
  public int getYearOfInvention() { return 0; }
78
  public float getDifficulty()    { return 1.0f; }
79
  public String getObjectName()   { return null; }
80
  public int getCategory()        { return 0; }
81
  public boolean supportsAdjustableStickerColors()  { return true; }
82
  public ObjectSignature getSignature()  { return mSignature; }
83
  public Class<? extends TwistyObject> getObjectClass() { return mClass; }
84
  }
(2-2/96)