コード例 #1
0
        public static NewPieceAction FromJSON(JSONClass json)
        {
            var action = new NewPieceAction();

            action.coord    = Coord.FromJSON(json["coord"]);
            action.newPiece = Piece.FromJSON(json["newPiece"]);
            return(action);
        }
コード例 #2
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);
        }