public static NewPieceAction FromJSON(JSONClass json) { var action = new NewPieceAction(); action.coord = Coord.FromJSON(json["coord"]); action.newPiece = Piece.FromJSON(json["newPiece"]); return(action); }
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); }