Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyBandagedEvil.java @ 6cf89a3e

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.objects;
21

    
22
import android.content.res.Resources;
23

    
24
import org.distorted.helpers.ScrambleState;
25
import org.distorted.library.main.DistortedEffects;
26
import org.distorted.library.main.DistortedTexture;
27
import org.distorted.library.mesh.MeshSquare;
28
import org.distorted.library.type.Static4D;
29
import org.distorted.main.R;
30

    
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32

    
33
class TwistyBandagedEvil extends TwistyBandagedAbstract
34
{
35
  private static final float[][] POSITIONS = new float[][]
36
      {
37
        { 1.0f,  1.0f, -1.0f},
38
        {-1.0f, -1.0f,  0.0f, -1.0f,  0.0f,  0.0f, 0.0f, -1.0f,  0.0f,  0.0f,  0.0f,  0.0f},
39
        {-1.0f,  1.0f, -1.0f,  0.0f,  1.0f, -1.0f},
40
        {-1.0f,  0.0f, -1.0f,  0.0f,  0.0f, -1.0f},
41
        {-1.0f, -1.0f, -1.0f,  0.0f, -1.0f, -1.0f},
42
        {-1.0f,  1.0f,  0.0f, -1.0f,  1.0f,  1.0f},
43
        { 0.0f,  1.0f,  0.0f,  0.0f,  1.0f,  1.0f},
44
        { 1.0f,  1.0f,  0.0f,  1.0f,  1.0f,  1.0f},
45
        {-1.0f, -1.0f,  1.0f, -1.0f,  0.0f,  1.0f},
46
        { 0.0f, -1.0f,  1.0f,  0.0f,  0.0f,  1.0f},
47
        { 1.0f, -1.0f,  1.0f,  1.0f,  0.0f,  1.0f},
48
        { 1.0f, -1.0f,  0.0f,  1.0f,  0.0f,  0.0f},
49
        { 1.0f, -1.0f, -1.0f,  1.0f,  0.0f, -1.0f}
50
      };
51

    
52
  private static final int[] QUAT_INDICES = new int[]
53
      { 0, 1, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 3 };
54

    
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56

    
57
  TwistyBandagedEvil(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
58
                     DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
59
    {
60
    super(size, quat, texture, mesh, effects, moves, ObjectList.BAN4, res, scrWidth);
61

    
62
    mStates = new ScrambleState[]
63
     {
64
     new ScrambleState( new int[][] {{2, 1,  1,2,-1,  2}         , {2, 2,142,2,-1, 28}         , {0, 1,114}          }),   //0
65
     new ScrambleState( new int[][] {{2, 2,  2}                  , {2,-1,143}                  , {}                  }),
66
     new ScrambleState( new int[][] {{2, 2,  1}                  , {}                          , {0, 1,  3,0, 2, 47} }),
67
     new ScrambleState( new int[][] {{2, 1,  4}                  , {2, 1,132,2,-1,131}         , {0, 1, 47,0,-1,  2} }),
68
     new ScrambleState( new int[][] {{2,-1,  3}                  , {2, 1,  5,2,-1,  6}         , {}                  }),
69
     new ScrambleState( new int[][] {{}                          , {2, 2,  6,2,-1,  4}         , {0, 1, 51}          }),
70
     new ScrambleState( new int[][] {{}                          , {2, 1,  4,2, 2,  5}         , {2, 2,  7,2,-1, 80} }),
71
     new ScrambleState( new int[][] {{2, 2,  8}                  , {}                          , {2, 1, 80,2, 2,  6} }),
72
     new ScrambleState( new int[][] {{2, 2,  7}                  , {}                          , {0,-1,  9}          }),
73
     new ScrambleState( new int[][] {{2, 1, 10,2, 2, 11,2,-1, 12}, {}                          , {0, 1,  8}          }),
74
     new ScrambleState( new int[][] {{2, 1, 11,2, 2, 12,2,-1,  9}, {}                          , {0,-1,118}          }),   //10
75
     new ScrambleState( new int[][] {{2, 1, 12,2, 2,  9,2,-1, 10}, {}                          , {2, 1, 77}          }),
76
     new ScrambleState( new int[][] {{2, 1,  9,2, 2, 10,2,-1, 11}, {}                          , {2, 1, 13,2, 2,143} }),
77
     new ScrambleState( new int[][] {{2, 1, 14,2, 2, 15,2,-1, 16}, {2, 1, 57,2,-1, 58}         , {2, 1,143,2,-1, 12} }),
78
     new ScrambleState( new int[][] {{2, 1, 15,2, 2, 16,2,-1, 13}, {}                          , {2, 1, 41}          }),
79
     new ScrambleState( new int[][] {{2, 1, 16,2, 2, 13,2,-1, 14}, {}                          , {0, 1, 82}          }),
80
     new ScrambleState( new int[][] {{2, 1, 13,2, 2, 14,2,-1, 15}, {2, 1, 17,2,-1, 18}         , {0, 1,111,0,-1,115} }),
81
     new ScrambleState( new int[][] {{}                          , {2, 2, 18,2,-1, 16}         , {0,-1,139}          }),
82
     new ScrambleState( new int[][] {{2, 1, 19,2,-1, 20}         , {2, 1, 16,2, 2, 17}         , {2, 1,142}          }),
83
     new ScrambleState( new int[][] {{2, 2, 20,2,-1, 18}         , {}                          , {2, 1, 39,2, 2,140} }),
84
     new ScrambleState( new int[][] {{2, 1, 18,2, 2, 19}         , {2, 1, 21}                  , {}                  }),   //20
85
     new ScrambleState( new int[][] {{}                          , {2,-1, 20}                  , {0,-1, 22}          }),
86
     new ScrambleState( new int[][] {{2, 2, 23,2,-1, 24}         , {}                          , {0, 1, 21}          }),
87
     new ScrambleState( new int[][] {{2, 1, 24,2, 2, 22}         , {}                          , {2, 1, 92}          }),
88
     new ScrambleState( new int[][] {{2, 1, 22,2,-1, 23}         , {}                          , {0, 1, 25}          }),
89
     new ScrambleState( new int[][] {{2, 1, 26,2, 2, 27}         , {}                          , {0,-1, 24}          }),
90
     new ScrambleState( new int[][] {{2, 1, 27,2,-1, 25}         , {2, 1, 74}                  , {}                  }),
91
     new ScrambleState( new int[][] {{2, 2, 25,2,-1, 26}         , {}                          , {2, 1, 28,2, 2,124} }),
92
     new ScrambleState( new int[][] {{2, 1, 29,2, 2, 30,2,-1, 31}, {2,-1,142}                  , {2, 1,124,2,-1, 27} }),
93
     new ScrambleState( new int[][] {{2, 1, 30,2, 2, 31,2,-1, 28}, {}                          , {2, 1,141}          }),
94
     new ScrambleState( new int[][] {{2, 1, 31,2, 2, 28,2,-1, 29}, {}                          , {0, 1,130}          }),   //30
95
     new ScrambleState( new int[][] {{2, 1, 28,2, 2, 29,2,-1, 30}, {2, 1, 32,2,-1, 33}         , {0, 1, 89,0,-1, 90} }),
96
     new ScrambleState( new int[][] {{}                          , {2, 2, 33,2,-1, 31}         , {0,-1,137}          }),
97
     new ScrambleState( new int[][] {{2, 1, 34}                  , {2, 1, 31,2, 2, 32}         , {}                  }),
98
     new ScrambleState( new int[][] {{2,-1, 33}                  , {}                          , {2, 1, 35}          }),
99
     new ScrambleState( new int[][] {{}                          , {2,-1, 36}                  , {2,-1, 34}          }),
100
     new ScrambleState( new int[][] {{}                          , {2, 1, 35}                  , {2,-1, 37}          }),
101
     new ScrambleState( new int[][] {{}                          , {2, 1, 38,2, 2, 93}         , {2, 1, 36}          }),
102
     new ScrambleState( new int[][] {{2, 1, 39}                  , {2, 1, 93,2,-1, 37}         , {}                  }),
103
     new ScrambleState( new int[][] {{2,-1, 38}                  , {2, 1, 40,2,-1, 64}         , {2, 1,140,2,-1, 19} }),
104
     new ScrambleState( new int[][] {{2, 1, 41,2,-1, 42}         , {2, 2, 64,2,-1, 39}         , {}                  }),   //40
105
     new ScrambleState( new int[][] {{2, 2, 42,2,-1, 40}         , {}                          , {2,-1, 14}          }),
106
     new ScrambleState( new int[][] {{2, 1, 40,2, 2, 41}         , {}                          , {0, 1, 43,0, 2,128} }),
107
     new ScrambleState( new int[][] {{2, 1, 44,2,-1, 45}         , {2, 1,114,2, 2,113,2,-1, 86}, {0, 1,128,0,-1, 42} }),
108
     new ScrambleState( new int[][] {{2, 2, 45,2,-1, 43}         , {2, 1, 48,2,-1,108}         , {2,-1, 81}          }),
109
     new ScrambleState( new int[][] {{2, 1, 43,2, 2, 44}         , {}                          , {0, 1, 46}          }),
110
     new ScrambleState( new int[][] {{}                          , {2, 1, 47}                  , {0,-1, 45}          }),
111
     new ScrambleState( new int[][] {{}                          , {2,-1, 46}                  , {0, 2,  2,0,-1,  3} }),
112
     new ScrambleState( new int[][] {{2,-1, 49}                  , {2, 2,108,2,-1, 44}         , {}                  }),
113
     new ScrambleState( new int[][] {{2, 1, 48}                  , {}                          , {0, 1, 50}          }),
114
     new ScrambleState( new int[][] {{}                          , {2, 1, 51,2, 2, 52}         , {0,-1, 49}          }),   //50
115
     new ScrambleState( new int[][] {{}                          , {2, 1, 52,2,-1, 50}         , {0,-1,  5}          }),
116
     new ScrambleState( new int[][] {{}                          , {2, 2, 50,2,-1, 51}         , {2,-1, 53}          }),
117
     new ScrambleState( new int[][] {{}                          , {2, 1, 54,2, 2, 55}         , {2, 1, 52}          }),
118
     new ScrambleState( new int[][] {{}                          , {2, 1, 55,2,-1, 53}         , {0,-1,104}          }),
119
     new ScrambleState( new int[][] {{}                          , {2, 2, 53,2,-1, 54}         , {0, 2, 56,0,-1, 65} }),
120
     new ScrambleState( new int[][] {{2, 1, 57}                  , {}                          , {0, 1, 65,0, 2, 55} }),
121
     new ScrambleState( new int[][] {{2,-1, 56}                  , {2, 2, 58,2,-1, 13}         , {}                  }),
122
     new ScrambleState( new int[][] {{}                          , {2, 1, 13,2, 2, 57}         , {2,-1, 59}          }),
123
     new ScrambleState( new int[][] {{2, 1, 60}                  , {}                          , {2, 1, 58}          }),
124
     new ScrambleState( new int[][] {{2,-1, 59}                  , {}                          , {2, 1, 61}          }),   //60
125
     new ScrambleState( new int[][] {{2,-1, 62}                  , {}                          , {2,-1, 60}          }),
126
     new ScrambleState( new int[][] {{2, 1, 61}                  , {2,-1, 63}                  , {}                  }),
127
     new ScrambleState( new int[][] {{}                          , {2, 1, 62}                  , {2, 1, 64}          }),
128
     new ScrambleState( new int[][] {{}                          , {2, 1, 39,2, 2, 40}         , {2,-1, 63}          }),
129
     new ScrambleState( new int[][] {{2, 1, 66,2,-1, 67}         , {2, 1, 78,2, 2, 79,2,-1, 80}, {0, 1, 55,0,-1, 56} }),
130
     new ScrambleState( new int[][] {{2, 2, 67,2,-1, 65}         , {2,-1,107}                  , {}                  }),
131
     new ScrambleState( new int[][] {{2, 1, 65,2, 2, 66}         , {}                          , {0, 1, 68}          }),
132
     new ScrambleState( new int[][] {{}                          , {2, 1, 69}                  , {0,-1, 67}          }),
133
     new ScrambleState( new int[][] {{}                          , {2,-1, 68}                  , {0,-1, 70}          }),
134
     new ScrambleState( new int[][] {{}                          , {2,-1, 71}                  , {0, 1, 69}          }),   //70
135
     new ScrambleState( new int[][] {{2,-1, 72}                  , {2, 1, 70}                  , {}                  }),
136
     new ScrambleState( new int[][] {{2, 1, 71}                  , {}                          , {0,-1, 73}          }),
137
     new ScrambleState( new int[][] {{2, 1, 74,2, 2, 75}         , {}                          , {0, 1, 72}          }),
138
     new ScrambleState( new int[][] {{2, 1, 75,2,-1, 73}         , {2,-1, 26}                  , {0, 1, 83,0,-1,138} }),
139
     new ScrambleState( new int[][] {{2, 2, 73,2,-1, 74}         , {2, 1, 76,2,-1, 77}         , {}                  }),
140
     new ScrambleState( new int[][] {{}                          , {2, 2, 77,2,-1, 75}         , {0, 1, 78}          }),
141
     new ScrambleState( new int[][] {{}                          , {2, 1, 75,2, 2, 76}         , {2,-1, 11}          }),
142
     new ScrambleState( new int[][] {{}                          , {2, 1, 79,2, 2, 80,2,-1, 65}, {0,-1, 76}          }),
143
     new ScrambleState( new int[][] {{}                          , {2, 1, 80,2, 2, 65,2,-1, 78}, {2,-1,110}          }),
144
     new ScrambleState( new int[][] {{2, 1, 81,2,-1, 82}         , {2, 1, 65,2, 2, 78,2,-1, 79}, {2, 1,  6,2,-1,  7} }),   //80
145
     new ScrambleState( new int[][] {{2, 2, 82,2,-1, 80}         , {}                          , {2, 1, 44}          }),
146
     new ScrambleState( new int[][] {{2, 1, 80,2, 2, 81}         , {2, 1, 83,2,-1, 84}         , {0,-1, 15}          }),
147
     new ScrambleState( new int[][] {{}                          , {2, 2, 84,2,-1, 82}         , {0, 2,138,0,-1, 74} }),
148
     new ScrambleState( new int[][] {{2, 1, 85}                  , {2, 1, 82,2, 2, 83}         , {}                  }),
149
     new ScrambleState( new int[][] {{2,-1, 84}                  , {}                          , {2, 1, 86,2, 2,119} }),
150
     new ScrambleState( new int[][] {{2, 1, 87,2,-1, 88}         , {2, 1, 43,2, 2,114,2,-1,113}, {2, 1,119,2,-1, 85} }),
151
     new ScrambleState( new int[][] {{2, 2, 88,2,-1, 86}         , {}                          , {2, 1, 94}          }),
152
     new ScrambleState( new int[][] {{2, 1, 86,2, 2, 87}         , {2, 1, 89}                  , {}                  }),
153
     new ScrambleState( new int[][] {{}                          , {2,-1, 88}                  , {0, 2, 90,0,-1, 31} }),
154
     new ScrambleState( new int[][] {{2, 1, 91,2, 2, 92}         , {}                          , {0, 1, 31,0, 2, 89} }),   //90
155
     new ScrambleState( new int[][] {{2, 1, 92,2,-1, 90}         , {}                          , {0, 1, 93}          }),
156
     new ScrambleState( new int[][] {{2, 2, 90,2,-1, 91}         , {}                          , {2,-1, 23}          }),
157
     new ScrambleState( new int[][] {{}                          , {2, 2, 37,2,-1, 38}         , {0,-1, 91}          }),
158
     new ScrambleState( new int[][] {{}                          , {2,-1, 95}                  , {2,-1, 87}          }),
159
     new ScrambleState( new int[][] {{}                          , {2, 1, 94}                  , {2,-1, 96}          }),
160
     new ScrambleState( new int[][] {{}                          , {2, 1, 97}                  , {2, 1, 95}          }),
161
     new ScrambleState( new int[][] {{2, 1, 98}                  , {2,-1, 96}                  , {}                  }),
162
     new ScrambleState( new int[][] {{2,-1, 97}                  , {}                          , {2,-1, 99}          }),
163
     new ScrambleState( new int[][] {{2, 2,100,2,-1,101}         , {}                          , {2, 1, 98}          }),
164
     new ScrambleState( new int[][] {{2, 1,101,2, 2, 99}         , {2, 1,111,2,-1,112}         , {}                  }),   //100
165
     new ScrambleState( new int[][] {{2, 1, 99,2,-1,100}         , {2, 1,102}                  , {2, 1,108,2,-1,109} }),
166
     new ScrambleState( new int[][] {{2, 1,103,2,-1,104}         , {2,-1,101}                  , {}                  }),
167
     new ScrambleState( new int[][] {{2, 2,104,2,-1,102}         , {}                          , {2,-1,105}          }),
168
     new ScrambleState( new int[][] {{2, 1,102,2, 2,103}         , {}                          , {0, 1, 54}          }),
169
     new ScrambleState( new int[][] {{2,-1,106}                  , {}                          , {2, 1,103}          }),
170
     new ScrambleState( new int[][] {{2, 1,105}                  , {}                          , {2, 1,107}          }),
171
     new ScrambleState( new int[][] {{}                          , {2, 1, 66}                  , {2,-1,106}          }),
172
     new ScrambleState( new int[][] {{}                          , {2, 1, 44,2, 2, 48}         , {2, 2,109,2,-1,101} }),
173
     new ScrambleState( new int[][] {{2,-1,110}                  , {}                          , {2, 1,101,2, 2,108} }),
174
     new ScrambleState( new int[][] {{2, 1,109}                  , {}                          , {2, 1, 79}          }),   //110
175
     new ScrambleState( new int[][] {{}                          , {2, 2,112,2,-1,100}         , {0, 2,115,0,-1, 16} }),
176
     new ScrambleState( new int[][] {{}                          , {2, 1,100,2, 2,111}         , {2, 1,113}          }),
177
     new ScrambleState( new int[][] {{}                          , {2, 1, 86,2, 2, 43,2,-1,114}, {2,-1,112}          }),
178
     new ScrambleState( new int[][] {{}                          , {2, 1,113,2, 2, 86,2,-1, 43}, {0,-1,  0}          }),
179
     new ScrambleState( new int[][] {{2, 2,116}                  , {}                          , {0, 1, 16,0, 2,111} }),
180
     new ScrambleState( new int[][] {{2, 2,115}                  , {}                          , {2,-1,117}          }),
181
     new ScrambleState( new int[][] {{2, 1,118}                  , {}                          , {2, 1,116}          }),
182
     new ScrambleState( new int[][] {{2,-1,117}                  , {}                          , {0, 1, 10}          }),
183
     new ScrambleState( new int[][] {{}                          , {2, 1,120,2, 2,121,2,-1,122}, {2, 2, 85,2,-1, 86} }),
184
     new ScrambleState( new int[][] {{}                          , {2, 1,121,2, 2,122,2,-1,119}, {2,-1,129}          }),   //120
185
     new ScrambleState( new int[][] {{}                          , {2, 1,122,2, 2,119,2,-1,120}, {0, 1,125}          }),
186
     new ScrambleState( new int[][] {{}                          , {2, 1,119,2, 2,120,2,-1,121}, {0,-1,123}          }),
187
     new ScrambleState( new int[][] {{}                          , {2, 2,124}                  , {0, 1,122}          }),
188
     new ScrambleState( new int[][] {{}                          , {2, 2,123}                  , {2, 2, 27,2,-1, 28} }),
189
     new ScrambleState( new int[][] {{}                          , {2, 1,126}                  , {0,-1,121}          }),
190
     new ScrambleState( new int[][] {{}                          , {2,-1,125}                  , {2,-1,127}          }),
191
     new ScrambleState( new int[][] {{}                          , {2, 2,128}                  , {2, 1,126}          }),
192
     new ScrambleState( new int[][] {{}                          , {2, 2,127}                  , {0, 2, 42,0,-1, 43} }),
193
     new ScrambleState( new int[][] {{2, 2,130,2,-1,131}         , {}                          , {2, 1,120}          }),
194
     new ScrambleState( new int[][] {{2, 1,131,2, 2,129}         , {}                          , {0,-1, 30}          }),   //130
195
     new ScrambleState( new int[][] {{2, 1,129,2,-1,130}         , {2, 1,  3,2, 2,132}         , {}                  }),
196
     new ScrambleState( new int[][] {{}                          , {2, 2,131,2,-1,  3}         , {0,-1,133}          }),
197
     new ScrambleState( new int[][] {{}                          , {2,-1,134}                  , {0, 1,132}          }),
198
     new ScrambleState( new int[][] {{2,-1,135}                  , {2, 1,133}                  , {}                  }),
199
     new ScrambleState( new int[][] {{2, 1,134}                  , {}                          , {0,-1,136}          }),
200
     new ScrambleState( new int[][] {{2, 1,137}                  , {}                          , {0, 1,135}          }),
201
     new ScrambleState( new int[][] {{2,-1,136}                  , {}                          , {0, 1, 32}          }),
202
     new ScrambleState( new int[][] {{2, 1,139}                  , {}                          , {0, 1, 74,0, 2, 83} }),
203
     new ScrambleState( new int[][] {{2,-1,138}                  , {}                          , {0, 1, 17}          }),
204
     new ScrambleState( new int[][] {{}                          , {2, 1,141}                  , {2, 2, 19,2,-1, 39} }),   //140
205
     new ScrambleState( new int[][] {{}                          , {2,-1,140}                  , {2,-1, 29}          }),
206
     new ScrambleState( new int[][] {{}                          , {2, 1, 28}                  , {2,-1, 18}          }),
207
     new ScrambleState( new int[][] {{}                          , {2, 1,  1}                  , {2, 2, 12,2,-1, 13} })
208
     };
209
    }
210

    
211
///////////////////////////////////////////////////////////////////////////////////////////////////
212

    
213
  float[][] getPositions()
214
    {
215
    return POSITIONS;
216
    }
217

    
218
///////////////////////////////////////////////////////////////////////////////////////////////////
219

    
220
  int[] getQuatIndices()
221
    {
222
    return QUAT_INDICES;
223
    }
224

    
225
///////////////////////////////////////////////////////////////////////////////////////////////////
226
// PUBLIC API
227

    
228
  public int getObjectName(int numLayers)
229
    {
230
    return R.string.bandaged_evil;
231
    }
232

    
233
///////////////////////////////////////////////////////////////////////////////////////////////////
234

    
235
  public int getInventor(int numLayers)
236
    {
237
    return R.string.bandaged_evil_inventor;
238
    }
239

    
240
///////////////////////////////////////////////////////////////////////////////////////////////////
241

    
242
  public int getComplexity(int numLayers)
243
    {
244
    return 8;
245
    }
246
}
(20-20/41)