Пример #1
0
 public void RotateTo(Orientation dest)
 {
     foreach (var act in RotateAction.GenerateActions(Orientation, dest))
     {
         Rotate(act.dir);
     }
 }
Пример #2
0
 public void RotateTo(Orientation dest)
 {
     foreach (var act in RotateAction.GenerateActions(Orientation, dest))
     {
         if (act == RotateAction.Left)
         {
             RotateLeft();
         }
         else
         {
             RotateRight();
         }
     }
 }
Пример #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);
        }