Project

General

Profile

Download (4.35 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / solvers / ImplementedSolversList.java @ 4a6b3b53

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 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.solvers;
11

    
12
import org.distorted.main.R;
13
import org.distorted.objectlib.signature.ObjectConstants;
14

    
15
///////////////////////////////////////////////////////////////////////////////////////////////////
16

    
17
public enum ImplementedSolversList
18
{
19
  CUBE2          (ObjectConstants.CUBE_2, R.string.solver_cube2_title, R.string.solver_cube2_description, true),
20
  CUBE3_KOCIEMBA (ObjectConstants.CUBE_3, R.string.solver_cube3_title, R.string.solver_cube3_description, true),
21
  CU_232         (ObjectConstants.CU_232, R.string.solver_cu232_title, R.string.solver_cu232_description, true),
22
  CU_323         (ObjectConstants.CU_323, R.string.solver_cu323_title, R.string.solver_cu323_description, true),
23
  PYRAMINX       (ObjectConstants.PYRA_3, R.string.solver_pyra3_title, R.string.solver_pyra3_description, true),
24
  SKEWB          (ObjectConstants.SKEW_2, R.string.solver_skew2_title, R.string.solver_skew2_description, true),
25
  PYRAMINX_DUO   (ObjectConstants.PDUO_2, R.string.solver_pduo2_title, R.string.solver_pduo2_description, true),
26
  IVY            (ObjectConstants.IVY_2 , R.string.solver_ivy_title, R.string.solver_ivy_description, true),
27
  DIAMOND        (ObjectConstants.DIAM_2, R.string.solver_diam2_title, R.string.solver_diam2_description, true),
28
  JING2          (ObjectConstants.JING_2, R.string.solver_jing2_title, R.string.solver_jing2_description, true),
29
  DINO6          (ObjectConstants.DINO_3, R.string.solver_dino6_title, R.string.solver_dino6_description, true),
30
  DINO4          (ObjectConstants.DIN4_3, R.string.solver_dino4_title, R.string.solver_dino4_description, true),
31
  PDIA           (ObjectConstants.PDIA_3, R.string.solver_pdia_title, R.string.solver_pdia_description, true),
32
  ;
33

    
34
  public static final int NUM_OBJECTS = values().length;
35

    
36
  private final int mObject;
37
  private final int mTitle;
38
  private final int mDescription;
39
  private final boolean mImplemented;
40

    
41
  private static final ImplementedSolversList[] objects;
42

    
43
  static
44
    {
45
    objects = new ImplementedSolversList[NUM_OBJECTS];
46
    int i=0;
47

    
48
    for(ImplementedSolversList object: ImplementedSolversList.values())
49
      {
50
      objects[i++] = object;
51
      }
52
    }
53

    
54
///////////////////////////////////////////////////////////////////////////////////////////////////
55

    
56
  public static ImplementedSolversList getSolver(int solverOrdinal)
57
    {
58
    return objects[solverOrdinal];
59
    }
60

    
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62

    
63
  public static int getSolverOrdinal(int objectOrdinal)
64
    {
65
    for(int o=0; o<NUM_OBJECTS; o++)
66
      if( objects[o].mObject==objectOrdinal ) return o;
67

    
68
    return -1;
69
    }
70

    
71
///////////////////////////////////////////////////////////////////////////////////////////////////
72

    
73
  ImplementedSolversList(int object, int title, int descripton, boolean implemented)
74
    {
75
    mObject      = object;
76
    mTitle       = title;
77
    mDescription = descripton;
78
    mImplemented = implemented;
79
    }
80

    
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82

    
83
  public int getObject()
84
    {
85
    return mObject;
86
    }
87

    
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89

    
90
  public int getTitle()
91
    {
92
    return mTitle;
93
    }
94

    
95
///////////////////////////////////////////////////////////////////////////////////////////////////
96

    
97
  public int getDescription()
98
    {
99
    return mDescription;
100
    }
101

    
102
///////////////////////////////////////////////////////////////////////////////////////////////////
103

    
104
  public boolean isImplemented()
105
    {
106
    return mImplemented;
107
    }
108
}
(1-1/16)