commit 1a2182dfaa8c61ea392b87fcb83070613825bf1e
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Mar 7 19:39:39 2023 +0100

    Master Icosamate: first code.

diff --git a/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java b/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
index 32636382..6a338cac 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
@@ -83,4 +83,5 @@ public class ObjectSignatures
   public static final int BALL_4 = ObjectType.BALL_4.ordinal();
   public static final int CA_333 = ObjectType.CA_333.ordinal();
   public static final int ICOS_2 = ObjectType.ICOS_2.ordinal();
+  public static final int ICOS_3 = ObjectType.ICOS_3.ordinal();
   }
diff --git a/src/main/java/org/distorted/objectlib/main/ObjectType.java b/src/main/java/org/distorted/objectlib/main/ObjectType.java
index 558fe2c0..ec68fe03 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectType.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectType.java
@@ -100,11 +100,14 @@ public enum ObjectType
   PDUO_2 ( TwistyPyraminxDuo.class    ,  4, R.drawable.pduo_2, true,     0, new InitData(new int[] {2,2,2,2})),
   PDIA_3 ( TwistyPyraminxDiamond.class, 12, R.drawable.pdia_3, true,    40, new InitData(new int[] {3,3,3})),
 
+  ICOS_2 ( TwistyIcosamate.class      , 30, R.drawable.icos_2, true,   60, new InitData(new int[] {2,2,2,2,2,2})),
+  ICOS_3 ( TwistyIcosamate.class      , 40, R.drawable.icos_2, true,   70, new InitData(new int[] {3,3,3,3,3,3})),
+
   BALL_4 ( TwistyMasterball.class     , 28, R.drawable.ball_4, false,   70, new InitData(new int[] {4,2,2,2,2})),
   BAN5_4 ( TwistyBandagedCuboid.class , 48, R.drawable.ban5_4, false,   50, new InitData(new int[] {4,4,4}, TwistyBandagedCuboid.POS_5)),
   BAN6_4 ( TwistyBandagedCuboid.class ,487, R.drawable.ban6_4, false,   50, new InitData(new int[] {4,4,4}, TwistyBandagedCuboid.POS_6)),
   CA_333 ( TwistyCamouflage.class     ,487, R.drawable.ca_333, false,   50, new InitData(new int[] {4,4,4}, TwistyCamouflage.CAM_333)),
-  ICOS_2 ( TwistyIcosamate.class      , 32, R.drawable.icos_2, false,   60, new InitData(new int[] {2,2,2,2,2,2})),
+
   ;
 
   public static int NUM_OBJECTS;
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyIcosamate.java b/src/main/java/org/distorted/objectlib/objects/TwistyIcosamate.java
index a0dbd120..9c4a3d8a 100644
--- a/src/main/java/org/distorted/objectlib/objects/TwistyIcosamate.java
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyIcosamate.java
@@ -99,7 +99,7 @@ public class TwistyIcosamate extends ShapeIcosahedron
     {
     if( mCuts==null )
       {
-      float[] cut = new float[] {0};
+      float[] cut = new float[] {0};  // TODO
       mCuts = new float[][] { cut,cut,cut,cut,cut,cut };
       }
 
@@ -110,7 +110,9 @@ public class TwistyIcosamate extends ShapeIcosahedron
 
   public boolean[][] getLayerRotatable(int[] numLayers)
     {
-    boolean[] tmp = new boolean[] {true,true};
+    int nL = numLayers[0];
+    boolean[] tmp = new boolean[nL];
+    for(int i=0; i<nL; i++) tmp[i] = true;
     return new boolean[][] { tmp,tmp,tmp,tmp,tmp,tmp };
     }
 
@@ -329,14 +331,15 @@ public class TwistyIcosamate extends ShapeIcosahedron
 
   public int getNumCubitVariants(int[] numLayers)
     {
-    return 2;
+    return getNumLayers()[0]==2 ? 2 : 3;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public int getCubitVariant(int cubit, int[] numLayers)
     {
-    return cubit<12 ? 0:1;
+    int N = getNumLayers()[0];
+    return cubit<12 ? 0 : (cubit<10*N*(N-1)+12 ? 1 : 2);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -387,53 +390,96 @@ public class TwistyIcosamate extends ShapeIcosahedron
 
   public String getShortName()
     {
-    return ObjectType.ICOS_2.name();
+    switch(getNumLayers()[0])
+      {
+      case 2: return ObjectType.ICOS_2.name();
+      case 3: return ObjectType.ICOS_3.name();
+      }
+
+    return null;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public ObjectSignature getSignature()
     {
-    return new ObjectSignature(ObjectSignatures.ICOS_2);
+    switch(getNumLayers()[0])
+      {
+      case 2: return new ObjectSignature(ObjectSignatures.ICOS_2);
+      case 3: return new ObjectSignature(ObjectSignatures.ICOS_3);
+      }
+
+    return null;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public String getObjectName()
     {
-    return "Icosamate";
+    switch(getNumLayers()[0])
+      {
+      case 2: return "Icosamate";
+      case 3: return "Master Icosamate";
+      }
+    return null;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public String getInventor()
     {
-    return "Jason Smith";
+    switch(getNumLayers()[0])
+      {
+      case 2: return "Jason Smith";
+      case 3: return "Keisuke Maruyama";
+      }
+    return null;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public int getYearOfInvention()
     {
-    return 2010;
+    switch(getNumLayers()[0])
+      {
+      case 2: return 2010;
+      case 3: return 2018;
+      }
+    return 0;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public int getComplexity()
     {
-    return 3;
+    return getNumLayers()[0]==2 ? 3 : 4;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public String[][] getTutorials()
     {
-    return new String[][] {
+    int[] numLayers = getNumLayers();
+
+    switch(numLayers[0])
+      {
+      case 2: return new String[][] {
                             {"gb","e7Es4Zx6Sl4","Icosamate introduction & algorithms","Superantoniovivaldi"},
                             {"gb","ZhkklbYfs98","Icosamate solve","Superantoniovivaldi"},
                             {"pl","eJTLTeoicWI","Icosamate TUTORIAL PL","MrUK"},
                             {"vn","RVjjxj9rPeg","BẠN PHẠM BẢO GIẢI ICOSAMATE","VĂN CÔNG TÙNG"},
                           };
+      case 3: return new String[][] {
+                            {"gb","77aBjBdfA2Q","Master Icosamate Algorithms","Superantoniovivaldi"},
+                            {"gb","j6AIwlIofFU","Master Icosamate Tutorial","Superantoniovivaldi"},
+                            {"gb","5Z1B5r6-CxM","Astrominx Tutorial","Jabberwock Technologies"},
+                            {"pl","","Icosamate TUTORIAL PL","MrUK"},
+                            {"vn","C4YO0B4rgTc","Tutorial N.237- Master Icosamate 1/3","Duy Thích Rubik"},
+                            {"vn","90m_0AoyOHU","Tutorial N.237- Master Icosamate 2/3","Duy Thích Rubik"},
+                            {"vn","LOd5qBwoP_k","Tutorial N.237- Master Icosamate 3/3","Duy Thích Rubik"},
+                          };
+      }
+
+    return null;
     }
 }
