Project

General

Profile

« Previous | Next » 

Revision 5f54927b

Added by Leszek Koltunski over 2 years ago

Preparation for local creation of puzzles: remove the 'ObjectType' enum from TwistyObject class.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
654 654

  
655 655
///////////////////////////////////////////////////////////////////////////////////////////////////
656 656

  
657
  public int[] getBasicAngles()
657
  public String getShortName()
658 658
    {
659
    if( mBasicAngle==null )
660
      {
661
      int[] num = getNumLayers();
662
      int x = num[1]==num[2] ? 4 : 2;
663
      int y = num[0]==num[2] ? 4 : 2;
664
      int z = num[0]==num[1] ? 4 : 2;
659
    int[] numLayers = getNumLayers();
665 660

  
666
      mBasicAngle = new int[] { x,y,z };
661
    int x = numLayers[0];
662
    int y = numLayers[1];
663

  
664
    switch(x)
665
      {
666
      case 2: switch(y)
667
                {
668
                case 2: return ObjectType.CUBE_2.name();
669
                case 3: return ObjectType.CU_232.name();
670
                }
671
      case 3: switch(y)
672
                {
673
                case 2: return ObjectType.CU_323.name();
674
                case 3: return ObjectType.CUBE_3.name();
675
                case 4: return ObjectType.CU_343.name();
676
                }
677
      case 4: return ObjectType.CUBE_4.name();
678
      case 5: return ObjectType.CUBE_5.name();
679
      case 6: return ObjectType.CUBE_6.name();
680
      case 7: return ObjectType.CUBE_7.name();
667 681
      }
668
    return mBasicAngle;
682

  
683
    return ObjectType.CUBE_3.name();
669 684
    }
670 685

  
671 686
///////////////////////////////////////////////////////////////////////////////////////////////////
672 687

  
673
  public ObjectType intGetObjectType(int[] numLayers)
688
  public long getSignature()
674 689
    {
690
    int[] numLayers = getNumLayers();
691

  
675 692
    int x = numLayers[0];
676 693
    int y = numLayers[1];
677 694

  
......
679 696
      {
680 697
      case 2: switch(y)
681 698
                {
682
                case 2: return ObjectType.CUBE_2;
683
                case 3: return ObjectType.CU_232;
699
                case 2: return ObjectType.CUBE_2.ordinal();
700
                case 3: return ObjectType.CU_232.ordinal();
684 701
                }
685 702
      case 3: switch(y)
686 703
                {
687
                case 2: return ObjectType.CU_323;
688
                case 3: return ObjectType.CUBE_3;
689
                case 4: return ObjectType.CU_343;
704
                case 2: return ObjectType.CU_323.ordinal();
705
                case 3: return ObjectType.CUBE_3.ordinal();
706
                case 4: return ObjectType.CU_343.ordinal();
690 707
                }
691
      case 4: return ObjectType.CUBE_4;
692
      case 5: return ObjectType.CUBE_5;
693
      case 6: return ObjectType.CUBE_6;
694
      case 7: return ObjectType.CUBE_7;
708
      case 4: return ObjectType.CUBE_4.ordinal();
709
      case 5: return ObjectType.CUBE_5.ordinal();
710
      case 6: return ObjectType.CUBE_6.ordinal();
711
      case 7: return ObjectType.CUBE_7.ordinal();
695 712
      }
696 713

  
697
    return ObjectType.CUBE_3;
714
    return ObjectType.CUBE_3.ordinal();
715
    }
716

  
717
///////////////////////////////////////////////////////////////////////////////////////////////////
718

  
719
  public int[] getBasicAngles()
720
    {
721
    if( mBasicAngle==null )
722
      {
723
      int[] num = getNumLayers();
724
      int x = num[1]==num[2] ? 4 : 2;
725
      int y = num[0]==num[2] ? 4 : 2;
726
      int z = num[0]==num[1] ? 4 : 2;
727

  
728
      mBasicAngle = new int[] { x,y,z };
729
      }
730
    return mBasicAngle;
698 731
    }
699 732

  
700 733
///////////////////////////////////////////////////////////////////////////////////////////////////
......
703 736
    {
704 737
    int[] numLayers = getNumLayers();
705 738

  
706
    switch(intGetObjectType(numLayers))
739
    int x = numLayers[0];
740
    int y = numLayers[1];
741

  
742
    switch(x)
707 743
      {
708
      case CUBE_2: return "Pocket Cube";
709
      case CU_232: return "Slim Tower";
710
      case CUBE_3: return "Rubik Cube";
711
      case CU_323: return "2x2x3 Cuboid";
712
      case CU_343: return "3x3x4 Cuboid";
713
      case CUBE_4: return "Rubik's Revenge";
714
      case CUBE_5: return "Professor's Cube";
715
      case CUBE_6: return "6x6 Cube";
716
      case CUBE_7: return "7x7 Cube";
744
      case 2: switch(y)
745
                {
746
                case 2: return "Pocket Cube";
747
                case 3: return "Slim Tower";
748
                }
749
      case 3: switch(y)
750
                {
751
                case 2: return "2x2x3 Cuboid";
752
                case 3: return "Rubik Cube";
753
                case 4: return "3x3x4 Cuboid";
754
                }
755
      case 4: return "Rubik's Revenge";
756
      case 5: return "Professor's Cube";
757
      case 6: return "6x6 Cube";
758
      case 7: return "7x7 Cube";
717 759
      }
760

  
718 761
    return "Rubik Cube";
719 762
    }
720 763

  
......
724 767
    {
725 768
    int[] numLayers = getNumLayers();
726 769

  
727
    switch(intGetObjectType(numLayers))
770
    int x = numLayers[0];
771
    int y = numLayers[1];
772

  
773
    switch(x)
728 774
      {
729
      case CUBE_2: return "Larry Nichols";
730
      case CU_232: return "Katsuhiko Okamoto";
731
      case CUBE_3: return "Ernő Rubik";
732
      case CU_323: return "Unknown";
733
      case CU_343: return "Cube4You";
734
      case CUBE_4: return "Péter Sebestény";
735
      case CUBE_5: return "Udo Krell";
736
      case CUBE_6:
737
      case CUBE_7: return "Panagiotis Verdes";
775
      case 2: switch(y)
776
                {
777
                case 2: return "Larry Nichols";
778
                case 3: return "Katsuhiko Okamoto";
779
                }
780
      case 3: switch(y)
781
                {
782
                case 2: return "Unknown";
783
                case 3: return "Ernő Rubik";
784
                case 4: return "Cube4You";
785
                }
786
      case 4: return "Péter Sebestény";
787
      case 5: return "Udo Krell";
788
      case 6:
789
      case 7: return "Panagiotis Verdes";
738 790
      }
739 791

  
740 792
    return "Ernő Rubik";
......
746 798
    {
747 799
    int[] numLayers = getNumLayers();
748 800

  
749
    switch(intGetObjectType(numLayers))
801
    int x = numLayers[0];
802
    int y = numLayers[1];
803

  
804
    switch(x)
750 805
      {
751
      case CUBE_2: return 1970;
752
      case CU_232: return 2001;
753
      case CUBE_3: return 1974;
754
      case CU_323: return 0;
755
      case CU_343: return 2009;
756
      case CUBE_4: return 1981;
757
      case CUBE_5: return 2002;
758
      case CUBE_6:
759
      case CUBE_7: return 2008;
806
      case 2: switch(y)
807
                {
808
                case 2: return 1970;
809
                case 3: return 2001;
810
                }
811
      case 3: switch(y)
812
                {
813
                case 2: return 0;
814
                case 3: return 1974;
815
                case 4: return 2009;
816
                }
817
      case 4: return 1981;
818
      case 5: return 2002;
819
      case 6:
820
      case 7: return 2008;
760 821
      }
761 822

  
762 823
    return 1974;
......
768 829
    {
769 830
    int[] numLayers = getNumLayers();
770 831

  
771
    switch(intGetObjectType(numLayers))
832
    int x = numLayers[0];
833
    int y = numLayers[1];
834

  
835
    switch(x)
772 836
      {
773
      case CUBE_2:
774
      case CU_232: return 1;
775
      case CUBE_3:
776
      case CU_323: return 2;
777
      case CU_343:
778
      case CUBE_4: return 3;
779
      case CUBE_5:
780
      case CUBE_6:
781
      case CUBE_7: return 4;
837
      case 2: switch(y)
838
                {
839
                case 2:
840
                case 3: return 1;
841
                }
842
      case 3: switch(y)
843
                {
844
                case 2:
845
                case 3: return 2;
846
                case 4: return 3;
847
                }
848
      case 4: return 3;
849
      case 5:
850
      case 6:
851
      case 7: return 4;
782 852
      }
853

  
783 854
    return 2;
784 855
    }
785 856

  
......
789 860
    {
790 861
    int[] numLayers = getNumLayers();
791 862

  
792
    switch(intGetObjectType(numLayers))
863
    int x = numLayers[0];
864
    int y = numLayers[1];
865

  
866
    switch(x)
793 867
      {
794
      case CUBE_2: return new String[][] {
868
      case 2: switch(y)
869
                {
870
                case 2: return new String[][] {
795 871
                          {"gb","rJlh5p2wAKA","How to Solve a 2x2 Rubik's Cube","Z3"},
796 872
                          {"es","f85wqJTIDlw","Resolver cubo de Rubik 2X2","Cuby"},
797 873
                          {"ru","azC6P3VYFkc","Как собрать кубик 2Х2","Е Бондаренко"},
......
802 878
                          {"kr","wTMsdWKq6No","2x2 큐브 공식을 이해하는 해법","듀나메스 큐브 해법연구소"},
803 879
                     //   {"tw","CfOCXxhCb8U","2x2魔術方塊復原","1hrBLD"},
804 880
                         };
805
      case CU_232: return new String[][] {
881
                case 3: return new String[][] {
806 882
                          {"gb","6dYOrUgFCsc","How to Solve the 2x2x3","Z3"},
807 883
                          {"es","5-ePFYnnY9k","Cuboid 2x2x3 Tutorial","Cubo da Loucura"},
808 884
                          {"ru","cT4CEQwgFKA","Как собрать Cuboid 2x2x3","YG Cuber"},
......
812 888
                          {"br","W6cp_1Q9SeY","Como resolver o cubóide 2x2x3","Pedro Filho"},
813 889
                          {"kr","DIaUaxQbJhw","2x2x3 해법","듀나메스 큐브 해법연구소"},
814 890
                         };
815
      case CUBE_3: return new String[][] {
891
                }
892
      case 3: switch(y)
893
                {
894
                case 2: return new String[][] {
895
                          {"gb","pbv652cE1AU","How To Solve the 3x3x2 ","JRCuber"},
896
                          {"es","RtDbnDxXPrs","Cuboid 3x3x2 Tutorial","Cubo da Loucura"},
897
                          {"ru","n5-fa1fd2cQ","Как собрать кубоид 3х3х2","RubicsGuide"},
898
                          {"fr","z6xToKiu38M","Résolution du 3x3x2","asthalis"},
899
                          {"de","3qI55VS5MrY","2x3x3 - Tutorial","GerCubing"},
900
                          {"pl","KSs928xIwKg","3x3x2 cube Tutorial PL","MrUK"},
901
                          {"br","RnjJBXOp9DA","Como resolver o cubóide 3x3x2","Pedro Filho"},
902
                          {"kr","E3Oj8bKcTO4","2x3x3 큐보이드해법","듀나메스 큐브 해법연구소"},
903
                         };
904
                case 3: return new String[][] {
816 905
                          {"gb","-8ohoCKN0Zw","How to Solve a Rubik's Cube","Z3"},
817 906
                          {"es","GyY0OxDk5lI","Resolver cubo de Rubik 3x3","Cuby"},
818 907
                          {"ru","5S2eq81FRzI","Как собрать кубик рубика","Е Бондаренко"},
......
825 914
                          {"kr","V5eeKu9abCc","3x3 큐브 기초해법 (파트3)","듀나메스 큐브 해법연구소"},
826 915
                     //   {"tw","76NmRQx5CLA","魔術方塊教學","1hrBLD"},
827 916
                         };
828
      case CU_323: return new String[][] {
829
                          {"gb","pbv652cE1AU","How To Solve the 3x3x2 ","JRCuber"},
830
                          {"es","RtDbnDxXPrs","Cuboid 3x3x2 Tutorial","Cubo da Loucura"},
831
                          {"ru","n5-fa1fd2cQ","Как собрать кубоид 3х3х2","RubicsGuide"},
832
                          {"fr","z6xToKiu38M","Résolution du 3x3x2","asthalis"},
833
                          {"de","3qI55VS5MrY","2x3x3 - Tutorial","GerCubing"},
834
                          {"pl","KSs928xIwKg","3x3x2 cube Tutorial PL","MrUK"},
835
                          {"br","RnjJBXOp9DA","Como resolver o cubóide 3x3x2","Pedro Filho"},
836
                          {"kr","E3Oj8bKcTO4","2x3x3 큐보이드해법","듀나메스 큐브 해법연구소"},
837
                         };
838
      case CU_343: return new String[][] {
917
                case 4: return new String[][] {
839 918
                          {"gb","nh8DqpMM3Ro","How to solve the 3x3x4","BeardedCubing"},
840 919
                          {"es","nfeJ1q_OoHU","Cuboid 3x3x4 Tutorial","Cubo da Loucura"},
841 920
                          {"ru","NCdQRMKWf-8","Как собрать Cuboid 3x3x4","YG Cuber"},
......
844 923
                          {"pl","YaPi8UGLKQQ","3x3x4 cube Tutorial PL","MrUK"},
845 924
                          {"kr","-kp5r7iXV0M","3x3x4 큐보이드해법","듀나메스 큐브 해법연구소"},
846 925
                         };
847
      case CUBE_4: return new String[][] {
926
                }
927
      case 4: return new String[][] {
848 928
                          {"gb","RR77Md71Ymc","How to Solve the 4x4 Rubik's Cube","Z3"},
849 929
                          {"es","d_4xk1r9hxU","Resolver cubo de Rubik 4x4","Cuby"},
850 930
                          {"ru","v5ytiOyTFSA","Как собрать кубик 4х4","Алексей Ярыгин"},
......
859 939
                      //    {"tw","PZvc5XJ2bLY","4x4魔術方塊復原#4","1hrBLD"},
860 940
                      //    {"tw","97vDE29lu2o","4x4魔術方塊復原#5","1hrBLD"},
861 941
                         };
862
      case CUBE_5: return new String[][] {
942
      case 5: return new String[][] {
863 943
                          {"gb","zMkNkXHzQts","How to Solve the 5x5 Rubik's Cube","Z3"},
864 944
                          {"es","6uaq-xfFs98","Resolver cubo de Rubik 5x5","Cuby"},
865 945
                          {"ru","UtKsyLk45uA","Как собрать кубик 5x5","Алексей Ярыгин"},
......
869 949
                          {"br","WQospjKXfvQ","Como resolver cubo 5x5","Pedro Filho"},
870 950
                          {"kr","D46qDaBFWNM","[555큐브]믿고보는영상!","Playon U온돌차"},
871 951
                         };
872
      case CUBE_6: return new String[][] {
952
      case 6: return new String[][] {
873 953
                          {"gb","SkZ9UadAOvQ","How to Solve the 6x6 Rubik's Cube","JPerm"},
874 954
                          {"es","9X-mW6wbnQQ","Resolver cubo de Rubik 6x6","Cuby"},
875 955
                          {"ru","yqEIek_l-44","Как собрать кубик Рубика 6х6","Алексей Ярыгин"},
......
878 958
                          {"pl","ZB4ROiJUb1o","Jak ułożyć kostkę 6x6x6","DżoDżo"},
879 959
                          {"kr","ZUyDa2_dVFU","6x6 큐브 맞추는 방법","iamzoone"},
880 960
                         };
881
      case CUBE_7: return new String[][] {
961
      case 7: return new String[][] {
882 962
                          {"gb","xpI7jKs4bWQ","7x7 Centers (1/2)","CubeSkills"},
883 963
                          {"gb","xpI7jKs4bWQ","7x7 Edges & 3x3 Stage (2/2)","CubeSkills"},
884 964
                          {"es","q43XpYapOR8","Resolver cubo de Rubik 7x7","Cuby"},
......
889 969
                          {"kr","3wynYMk4eZk","7x7 큐브 맞추는 방법","iamzoone"},
890 970
                         };
891 971
      }
972

  
892 973
    return null;
893 974
    }
894 975
}

Also available in: Unified diff