コード例 #1
0
 public VisualCubeBlock this[CubeFaceletType type]
 {
     get
     {
         VisualCubeBlock blockRet = null;
         foreach (VisualCubeBlock item in _blocks)
         {
             if (item.Square == type)
             {
                 blockRet = item;
                 break;
             }
         }
         if (blockRet != null)
             return blockRet;
         else
             throw new IndexOutOfRangeException();
     }
     set
     {
         int index = -1;
         for (int i = 0; i < _blocks.Count; i++)
         {
             if (_blocks[i].Square == type)
             {
                 index = i;
                 break;
             }
         }
         if (index >= 0)
             _blocks[index] = value;
         else
             throw new IndexOutOfRangeException();
     }
 }
コード例 #2
0
 public static Point GetPoint(CubeFaceType face, CubeFaceletType square)
 {
     return positions[face.GetHashCode(), square.GetHashCode()];
 }