Project

General

Profile

« Previous | Next » 

Revision 6fd4a72c

Added by Leszek Koltunski about 4 years ago

Preparation for the Object Info popup: add the name, inventor, complexity info to each object.

View differences:

src/main/java/org/distorted/objects/TwistyCube.java
29 29
import org.distorted.library.mesh.MeshSquare;
30 30
import org.distorted.library.type.Static3D;
31 31
import org.distorted.library.type.Static4D;
32
import org.distorted.main.R;
32 33
import org.distorted.main.RubikSurfaceView;
33 34

  
34 35
import java.util.Random;
......
485 486

  
486 487
    return objectString.toString();
487 488
    }
489

  
490
///////////////////////////////////////////////////////////////////////////////////////////////////
491

  
492
  public int getObjectName(int numLayers)
493
    {
494
    switch(numLayers)
495
      {
496
      case 2: return R.string.cube2;
497
      case 3: return R.string.cube3;
498
      case 4: return R.string.cube4;
499
      case 5: return R.string.cube5;
500
      }
501
    return R.string.cube3;
502
    }
503

  
504
///////////////////////////////////////////////////////////////////////////////////////////////////
505

  
506
  public int getInventor(int numLayers)
507
    {
508
    switch(numLayers)
509
      {
510
      case 2: return R.string.cube2_inventor;
511
      case 3: return R.string.cube3_inventor;
512
      case 4: return R.string.cube4_inventor;
513
      case 5: return R.string.cube5_inventor;
514
      }
515
    return R.string.cube3_inventor;
516
    }
517

  
518
///////////////////////////////////////////////////////////////////////////////////////////////////
519

  
520
  public int getComplexity(int numLayers)
521
    {
522
    switch(numLayers)
523
      {
524
      case 2: return 4;
525
      case 3: return 6;
526
      case 4: return 8;
527
      case 5: return 10;
528
      }
529
    return 6;
530
    }
488 531
}
src/main/java/org/distorted/objects/TwistyDiamond.java
30 30
import org.distorted.library.mesh.MeshSquare;
31 31
import org.distorted.library.type.Static3D;
32 32
import org.distorted.library.type.Static4D;
33
import org.distorted.main.R;
33 34
import org.distorted.main.RubikSurfaceView;
34 35

  
35 36
import java.util.Random;
......
422 423
    return "";
423 424
    }
424 425

  
426
///////////////////////////////////////////////////////////////////////////////////////////////////
427

  
428
  public int getObjectName(int numLayers)
429
    {
430
    return R.string.diam2;
431
    }
432

  
433
///////////////////////////////////////////////////////////////////////////////////////////////////
434

  
435
  public int getInventor(int numLayers)
436
    {
437
    return R.string.diam2_inventor;
438
    }
439

  
440
///////////////////////////////////////////////////////////////////////////////////////////////////
441

  
442
  public int getComplexity(int numLayers)
443
    {
444
    return 5;
445
    }
425 446
}
src/main/java/org/distorted/objects/TwistyDino.java
279 279
    {
280 280
    return "";
281 281
    }
282

  
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284

  
285
  public int getComplexity(int numLayers)
286
    {
287
    return 2;
288
    }
282 289
}
src/main/java/org/distorted/objects/TwistyDino4.java
25 25
import org.distorted.library.main.DistortedTexture;
26 26
import org.distorted.library.mesh.MeshSquare;
27 27
import org.distorted.library.type.Static4D;
28
import org.distorted.main.R;
28 29

  
29 30
import java.util.Random;
30 31

  
......
108 109

  
109 110
    return true;
110 111
    }
112

  
113
///////////////////////////////////////////////////////////////////////////////////////////////////
114

  
115
  public int getObjectName(int numLayers)
116
    {
117
    return R.string.din43;
118
    }
119

  
120
///////////////////////////////////////////////////////////////////////////////////////////////////
121

  
122
  public int getInventor(int numLayers)
123
    {
124
    return R.string.din43_inventor;
125
    }
111 126
}
src/main/java/org/distorted/objects/TwistyDino6.java
25 25
import org.distorted.library.main.DistortedTexture;
26 26
import org.distorted.library.mesh.MeshSquare;
27 27
import org.distorted.library.type.Static4D;
28
import org.distorted.main.R;
28 29

  
29 30
import java.util.Random;
30 31

  
......
105 106

  
106 107
    return ( qX==qY && qX==qZ ) || ( qY==mulQuat(qX,2) && qZ==mulQuat(qX,8) );
107 108
    }
109

  
110
///////////////////////////////////////////////////////////////////////////////////////////////////
111

  
112
  public int getObjectName(int numLayers)
113
    {
114
    return R.string.dino3;
115
    }
116

  
117
///////////////////////////////////////////////////////////////////////////////////////////////////
118

  
119
  public int getInventor(int numLayers)
120
    {
121
    return R.string.dino3_inventor;
122
    }
108 123
}
src/main/java/org/distorted/objects/TwistyHelicopter.java
30 30
import org.distorted.library.mesh.MeshSquare;
31 31
import org.distorted.library.type.Static3D;
32 32
import org.distorted.library.type.Static4D;
33
import org.distorted.main.R;
33 34
import org.distorted.main.RubikSurfaceView;
34 35

  
35 36
import java.util.Random;
......
482 483
    {
483 484
    return "";
484 485
    }
486

  
487
///////////////////////////////////////////////////////////////////////////////////////////////////
488

  
489
  public int getObjectName(int numLayers)
490
    {
491
    return R.string.heli3;
492
    }
493

  
494
///////////////////////////////////////////////////////////////////////////////////////////////////
495

  
496
  public int getInventor(int numLayers)
497
    {
498
    return R.string.heli3_inventor;
499
    }
500

  
501
///////////////////////////////////////////////////////////////////////////////////////////////////
502

  
503
  public int getComplexity(int numLayers)
504
    {
505
    return 8;
506
    }
485 507
}
src/main/java/org/distorted/objects/TwistyIvy.java
30 30
import org.distorted.library.mesh.MeshSquare;
31 31
import org.distorted.library.type.Static3D;
32 32
import org.distorted.library.type.Static4D;
33
import org.distorted.main.R;
33 34
import org.distorted.main.RubikSurfaceView;
34 35

  
35 36
import java.util.Random;
......
397 398
    {
398 399
    return "";
399 400
    }
401

  
402
///////////////////////////////////////////////////////////////////////////////////////////////////
403

  
404
  public int getObjectName(int numLayers)
405
    {
406
    return R.string.ivy2;
407
    }
408

  
409
///////////////////////////////////////////////////////////////////////////////////////////////////
410

  
411
  public int getInventor(int numLayers)
412
    {
413
    return R.string.ivy2_inventor;
414
    }
415

  
416
///////////////////////////////////////////////////////////////////////////////////////////////////
417

  
418
  public int getComplexity(int numLayers)
419
    {
420
    return 1;
421
    }
400 422
}
src/main/java/org/distorted/objects/TwistyObject.java
771 771
  public abstract String retObjectString();
772 772
  public abstract int randomizeNewRotAxis(Random rnd, int oldRotAxis);
773 773
  public abstract int randomizeNewRow(Random rnd, int oldRotAxis, int oldRow, int newRotAxis);
774
  public abstract int getObjectName(int numLayers);
775
  public abstract int getInventor(int numLayers);
776
  public abstract int getComplexity(int numLayers);
774 777
  }
src/main/java/org/distorted/objects/TwistyPyraminx.java
29 29
import org.distorted.library.mesh.MeshSquare;
30 30
import org.distorted.library.type.Static3D;
31 31
import org.distorted.library.type.Static4D;
32
import org.distorted.main.R;
32 33
import org.distorted.main.RubikSurfaceView;
33 34

  
34 35
import java.util.Random;
......
401 402
    {
402 403
    return "";
403 404
    }
405

  
406
///////////////////////////////////////////////////////////////////////////////////////////////////
407

  
408
  public int getObjectName(int numLayers)
409
    {
410
    switch(numLayers)
411
      {
412
      case 3: return R.string.pyra3;
413
      case 4: return R.string.pyra4;
414
      case 5: return R.string.pyra5;
415
      }
416
    return R.string.pyra3;
417
    }
418

  
419
///////////////////////////////////////////////////////////////////////////////////////////////////
420

  
421
  public int getInventor(int numLayers)
422
    {
423
    switch(numLayers)
424
      {
425
      case 3: return R.string.pyra3_inventor;
426
      case 4: return R.string.pyra4_inventor;
427
      case 5: return R.string.pyra5_inventor;
428
      }
429
    return R.string.pyra3_inventor;
430
    }
431

  
432
///////////////////////////////////////////////////////////////////////////////////////////////////
433

  
434
  public int getComplexity(int numLayers)
435
    {
436
    switch(numLayers)
437
      {
438
      case 3: return 4;
439
      case 4: return 6;
440
      case 5: return 8;
441
      }
442
    return 4;
443
    }
404 444
}
src/main/java/org/distorted/objects/TwistyRedi.java
30 30
import org.distorted.library.mesh.MeshSquare;
31 31
import org.distorted.library.type.Static3D;
32 32
import org.distorted.library.type.Static4D;
33
import org.distorted.main.R;
33 34
import org.distorted.main.RubikSurfaceView;
34 35

  
35 36
import java.util.Random;
......
430 431
    {
431 432
    return "";
432 433
    }
434

  
435
///////////////////////////////////////////////////////////////////////////////////////////////////
436

  
437
  public int getObjectName(int numLayers)
438
    {
439
    return R.string.redi2;
440
    }
441

  
442
///////////////////////////////////////////////////////////////////////////////////////////////////
443

  
444
  public int getInventor(int numLayers)
445
    {
446
    return R.string.redi2_inventor;
447
    }
448

  
449
///////////////////////////////////////////////////////////////////////////////////////////////////
450

  
451
  public int getComplexity(int numLayers)
452
    {
453
    return 4;
454
    }
433 455
}
src/main/java/org/distorted/objects/TwistySkewb.java
32 32
import org.distorted.library.mesh.MeshSquare;
33 33
import org.distorted.library.type.Static3D;
34 34
import org.distorted.library.type.Static4D;
35
import org.distorted.main.R;
35 36
import org.distorted.main.RubikSurfaceView;
36 37

  
37 38
import java.util.Random;
......
661 662
    {
662 663
    return "";
663 664
    }
665

  
666
///////////////////////////////////////////////////////////////////////////////////////////////////
667

  
668
  public int getObjectName(int numLayers)
669
    {
670
    switch(numLayers)
671
      {
672
      case 2: return R.string.skew2;
673
      case 3: return R.string.skew3;
674
      }
675
    return R.string.skew2;
676
    }
677

  
678
///////////////////////////////////////////////////////////////////////////////////////////////////
679

  
680
  public int getInventor(int numLayers)
681
    {
682
    switch(numLayers)
683
      {
684
      case 2: return R.string.skew2_inventor;
685
      case 3: return R.string.skew3_inventor;
686
      }
687
    return R.string.skew2_inventor;
688
    }
689

  
690
///////////////////////////////////////////////////////////////////////////////////////////////////
691

  
692
  public int getComplexity(int numLayers)
693
    {
694
    switch(numLayers)
695
      {
696
      case 2: return 5;
697
      case 3: return 9;
698
      }
699
    return 5;
700
    }
664 701
}
src/main/res/values/strings.xml
1 1
<resources>
2 2
    <string name="app_name">Magic Cube</string>
3 3
    <string name="distorted" translatable="false">DISTORTED</string>
4
    <string name="opengl_error" translatable="false">Error</string>
5
    <string name="opengl_error_text" translatable="false">This device does not support OpenGL 3.0</string>
6 4
    <string name="scramble">Scramble</string>
7 5
    <string name="solve">Solve</string>
8 6
    <string name="exit">Exit</string>
......
37 35
    <string name="new_name_try_again">The name you have chosen, %s, is already taken. Try again:</string>
38 36
    <string name="downloading">Downloading…</string>
39 37
    <string name="submitting">Submitting…</string>
40
    <string name="privacy_policy">Privacy Policy</string>
41
    <string name="privacy_policy_text">Please see and accept our <a href="https://distorted.org/redmine/projects/magic-cube/wiki/Privacy_policy">Privacy Policy</a></string>
42
    <string name="accept">Accept</string>
43
    <string name="decline">Decline</string>
44 38
    <string name="credits1">Open Source app developed using the Distorted graphics library. Licensed under <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPL version 2</a> or - at your option - any later version.</string>
45 39
    <string name="credits2">Pretty Patterns by Walter Randelshofer. See <a href="http://www.randelshofer.ch">http://www.randelshofer.ch</a></string>
46 40
    <string name="credits3">Download code, take a look at tutorials, learn how to add your own graphics effect, learn how to code your own object, contribute a Pretty Pattern, implement your own solver, or report a bug: \n\n<a href="https://distorted.org/redmine/projects/magic-cube/wiki">Distorted.org</a></string>
47
    <string name="credits4">Please see our <a href="https://distorted.org/redmine/projects/magic-cube/wiki/Privacy_policy">Privacy Policy</a></string>
41
    <string name="credits4" translatable="false">Please see our <a href="https://distorted.org/redmine/projects/magic-cube/wiki/Privacy_policy">Privacy Policy</a></string>
48 42

  
49
    <string name="solver_generic_error1">Solver for this object and size not implemented yet!</string>
43
    <string name="privacy_policy" translatable="false">Privacy Policy</string>
44
    <string name="privacy_policy_text" translatable="false">Please see and accept our <a href="https://distorted.org/redmine/projects/magic-cube/wiki/Privacy_policy">Privacy Policy</a></string>
45
    <string name="accept" translatable="false">Accept</string>
46
    <string name="decline" translatable="false">Decline</string>
47

  
48
    <string name="opengl_error" translatable="false">Error</string>
49
    <string name="opengl_error_text" translatable="false">This device does not support OpenGL 3.0</string>
50 50

  
51
    <string name="solver_generic_error1">Solver for this object and size not implemented yet!</string>
51 52
    <string name="solver_cube3_error1">There are not exactly 9 facelets of each color!</string>
52 53
    <string name="solver_cube3_error2">Not all 12 edges exist exactly once!</string>
53 54
    <string name="solver_cube3_error3">One edge has to be flipped!</string>
......
65 66
    <string name="ti_placeholder">%1$.2f seconds</string>
66 67
    <string name="mo_placeholder">%1$d/%2$d</string>
67 68
    <string name="sq_placeholder" translatable="false">%1$2d.</string>
69

  
70
    <string name="cube2" translatable="false">Pocket Cube</string>
71
    <string name="cube3" translatable="false">Rubik Cube</string>
72
    <string name="cube4" translatable="false">Rubik\'s Revenge</string>
73
    <string name="cube5" translatable="false">Professor\'s Cube</string>
74
    <string name="pyra3" translatable="false">Pyraminx</string>
75
    <string name="pyra4" translatable="false">Master Pyraminx</string>
76
    <string name="pyra5" translatable="false">Professor\'s Pyraminx</string>
77
    <string name="skew2" translatable="false">Skewb</string>
78
    <string name="skew3" translatable="false">Master Skewb</string>
79
    <string name="diam2" translatable="false">Skewb Diamond</string>
80
    <string name="redi2" translatable="false">Redi Cube</string>
81
    <string name="heli3" translatable="false">Helicopter Cube</string>
82
    <string name="ivy2"  translatable="false">Ivy Cube</string>
83
    <string name="dino3" translatable="false">Dino Cube (6 color)</string>
84
    <string name="din43" translatable="false">Dino Cube (4 color)</string>
85

  
86
    <string name="cube2_inventor" translatable="false">Larry Nichols, 1970</string>
87
    <string name="cube3_inventor" translatable="false">Ernő Rubik, 1974</string>
88
    <string name="cube4_inventor" translatable="false">Péter Sebestény, 1981</string>
89
    <string name="cube5_inventor" translatable="false">Udo Krell, 1981</string>
90
    <string name="pyra3_inventor" translatable="false">Uwe Meffert, 1970</string>
91
    <string name="pyra4_inventor" translatable="false">Katsuhiko Okamoto, 2002</string>
92
    <string name="pyra5_inventor" translatable="false">Timur Evbatyrov, 2011</string>
93
    <string name="skew2_inventor" translatable="false">Tony Durham, 1982</string>
94
    <string name="skew3_inventor" translatable="false">Katsuhiko Okamoto, 2003</string>
95
    <string name="diam2_inventor" translatable="false">Uwe Meffert, 1984</string>
96
    <string name="redi2_inventor" translatable="false">Oskar van Deventer, 2009</string>
97
    <string name="heli3_inventor" translatable="false">Adam G. Cowan, 2006</string>
98
    <string name="ivy2_inventor"  translatable="false">Eitan Cher, 2009</string>
99
    <string name="dino3_inventor" translatable="false">Robert Webb, 1985</string>
100
    <string name="din43_inventor" translatable="false">Robert Webb, 1985</string>
101

  
68 102
</resources>

Also available in: Unified diff