Project

General

Profile

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

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

1 ae9d9227 leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
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 baa031e2 leszek
import org.distorted.objectlib.signature.ObjectSignature;
15 ae9d9227 leszek
16
///////////////////////////////////////////////////////////////////////////////////////////////////
17
18
public class Metadata
19
  {
20 de830b16 leszek
  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 09d5cf2b leszek
  public static final int CATEGORY_SHAPE_BAR    = 7;
28 de830b16 leszek
29
  public static final int CATEGORY_AXIS_FACE    = (0<<3);  // next 2 bits
30
  public static final int CATEGORY_AXIS_EDGE    = (1<<3);
31
  public static final int CATEGORY_AXIS_CORN    = (2<<3);
32
  public static final int CATEGORY_AXIS_OTHE    = (3<<3);
33
34
  public static final int CATEGORY_GHOST        = (1<<5);  // from now on, individual bits
35
  public static final int CATEGORY_MIRROR       = (1<<6);
36
  public static final int CATEGORY_CUBOID       = (1<<7);
37
  public static final int CATEGORY_SHAPEMOD_3x3 = (1<<8);
38
  public static final int CATEGORY_SHAPEMOD_SKE = (1<<9);
39
  public static final int CATEGORY_MIXUP        = (1<<10);
40
  public static final int CATEGORY_COIN         = (1<<11);
41
  public static final int CATEGORY_CRAZY        = (1<<12);
42
  public static final int CATEGORY_SQUARE       = (1<<13);
43
  public static final int CATEGORY_BANDAGED     = (1<<14);
44
  public static final int CATEGORY_VOID         = (1<<15);
45
46 ae9d9227 leszek
  private final int[] mNumLayers;
47
  private final int mParam;
48
  private final float[][] mPos;
49
  private final Class<? extends TwistyObject> mClass;
50 baa031e2 leszek
  private final ObjectSignature mSignature;
51 ae9d9227 leszek
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53
54 baa031e2 leszek
  public Metadata(Class<? extends TwistyObject> clazz, int[] layers, int param, float[][] pos, int objConstant)
55 ae9d9227 leszek
    {
56
    mNumLayers = layers;
57
    mParam     = param;
58
    mPos       = pos;
59
    mClass     = clazz;
60 baa031e2 leszek
    mSignature =  new ObjectSignature(objConstant);
61 ae9d9227 leszek
    }
62
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65 743cdab7 leszek
  public int numScrambles()       { return 1; }
66
  public int icon()               { return R.drawable.cube_3; }
67
  public boolean getActive()      { return true; }
68
  public int price()              { return 0; }
69
  public int objectVersion()      { return 1; }
70
  public int extrasVersion()      { return 1; }
71
  public int[] getNumLayers()     { return mNumLayers; }
72
  public int getParam()           { return mParam; }
73
  public float[][] getPos()       { return mPos; }
74
  public int extrasJson()         { return 0; }
75
  public int objectJson()         { return 0; }
76
  public int mesh()               { return 0; }
77 71df2bd4 leszek
  public String getAuthor()       { return null; }
78 743cdab7 leszek
  public int getYearOfInvention() { return 0; }
79 71df2bd4 leszek
  public float getDifficulty()    { return 1.0f; }
80 743cdab7 leszek
  public String getObjectName()   { return null; }
81 de830b16 leszek
  public int getCategory()        { return 0; }
82 ade99032 leszek
  public boolean supportsAdjustableStickerColors()  { return true; }
83 baa031e2 leszek
  public ObjectSignature getSignature()  { return mSignature; }
84 ae9d9227 leszek
  public Class<? extends TwistyObject> getObjectClass() { return mClass; }
85
  }