Project

General

Profile

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

magiccube / src / main / java / org / distorted / solvers / ImplementedSolversList.java @ 7a6892e4

1 373fa45f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6 bb62ca3f Leszek Koltunski
// 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 373fa45f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10
package org.distorted.solvers;
11
12 93a1c364 Leszek Koltunski
import org.distorted.main.R;
13 e4733ed7 Leszek Koltunski
import org.distorted.objectlib.main.ObjectSignatures;
14 373fa45f Leszek Koltunski
15
///////////////////////////////////////////////////////////////////////////////////////////////////
16
17
public enum ImplementedSolversList
18
{
19 bb10ab21 Leszek Koltunski
  CUBE2          (ObjectSignatures.CUBE_2, R.string.solver_cube2_title, R.string.solver_cube2_description, true),
20 93a1c364 Leszek Koltunski
  CUBE3_KOCIEMBA (ObjectSignatures.CUBE_3, R.string.solver_cube3_title, R.string.solver_cube3_description, true),
21 baddedaf Leszek Koltunski
  PYRAMINX       (ObjectSignatures.PYRA_3, R.string.solver_pyra3_title, R.string.solver_pyra3_description, true),
22 a7cfc9a9 Leszek Koltunski
  PYRAMINX_DUO   (ObjectSignatures.PDUO_2, R.string.solver_pduo2_title, R.string.solver_pduo2_description, true),
23
  IVY            (ObjectSignatures.IVY_2 , R.string.solver_ivy_title, R.string.solver_ivy_description, true),
24
  TOWER          (ObjectSignatures.CU_232, R.string.solver_cu232_title, R.string.solver_cu232_description, true),
25
  DIAMOND        (ObjectSignatures.DIAM_2, R.string.solver_diam2_title, R.string.solver_diam2_description, true),
26
  SKEWB          (ObjectSignatures.SKEW_2, R.string.solver_skew2_title, R.string.solver_skew2_description, false),
27 bb10ab21 Leszek Koltunski
  JING2          (ObjectSignatures.JING_2, R.string.solver_jing2_title, R.string.solver_jing2_description, false),
28 373fa45f Leszek Koltunski
  ;
29
30
  public static final int NUM_OBJECTS = values().length;
31
32 d433b50e Leszek Koltunski
  private final int mObject;
33 93a1c364 Leszek Koltunski
  private final int mTitle;
34
  private final int mDescription;
35
  private final boolean mImplemented;
36 373fa45f Leszek Koltunski
37
  private static final ImplementedSolversList[] objects;
38
39
  static
40
    {
41
    objects = new ImplementedSolversList[NUM_OBJECTS];
42
    int i=0;
43
44
    for(ImplementedSolversList object: ImplementedSolversList.values())
45
      {
46
      objects[i++] = object;
47
      }
48
    }
49
50
///////////////////////////////////////////////////////////////////////////////////////////////////
51
52 93a1c364 Leszek Koltunski
  public static ImplementedSolversList getSolver(int ordinal)
53 373fa45f Leszek Koltunski
    {
54 93a1c364 Leszek Koltunski
    return objects[ordinal];
55 373fa45f Leszek Koltunski
    }
56
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58
59 93a1c364 Leszek Koltunski
  ImplementedSolversList(int object, int title, int descripton, boolean implemented)
60 373fa45f Leszek Koltunski
    {
61 93a1c364 Leszek Koltunski
    mObject      = object;
62
    mTitle       = title;
63
    mDescription = descripton;
64
    mImplemented = implemented;
65
    }
66
67
///////////////////////////////////////////////////////////////////////////////////////////////////
68
69
  public int getObject()
70
    {
71
    return mObject;
72
    }
73
74
///////////////////////////////////////////////////////////////////////////////////////////////////
75
76
  public int getTitle()
77
    {
78
    return mTitle;
79
    }
80
81
///////////////////////////////////////////////////////////////////////////////////////////////////
82
83
  public int getDescription()
84
    {
85
    return mDescription;
86
    }
87
88
///////////////////////////////////////////////////////////////////////////////////////////////////
89
90
  public boolean isImplemented()
91
    {
92
    return mImplemented;
93 373fa45f Leszek Koltunski
    }
94
}