Esempio n. 1
0
 public void RotateTo(Orientation dest)
 {
     foreach (var act in RotateAction.GenerateActions(Orientation, dest))
     {
         Rotate(act.dir);
     }
 }
Esempio n. 2
0
 public void RotateTo(Orientation dest)
 {
     foreach (var act in RotateAction.GenerateActions(Orientation, dest))
     {
         if (act == RotateAction.Left)
         {
             RotateLeft();
         }
         else
         {
             RotateRight();
         }
     }
 }
Esempio n. 3
0
        public static BoardAction FromJSON(JSONNode json)
        {
            switch (json["type"].ToString())
            {
            case "rotate":
                return(RotateAction.FromJSON(json));

            case "compact":
                return(CompactAction.FromJSON(json));

            case "remove":
                return(RemoveAction.FromJSON(json));

            case "fall":
                return(FallAction.FromJSON(json));

            case "new":
                return(NewPieceAction.FromJSON(json));
            }
            return(null);
        }