/// <summary> /// Sendet Information über ausgewählte Spalte an Server /// </summary> /// <param name="clickedColumn"></param> /// <returns></returns> public static bool SendColumnToServer(int clickedColumn) { #pragma warning disable IDE0017 // Simplify object initialization DataPlayerTurn playerTurn = new DataPlayerTurn(); #pragma warning restore IDE0017 // Simplify object initialization playerTurn.ClientID = String.Empty; playerTurn.Column = clickedColumn; SendData(String.Format("{0}{1}", PREFIX_TDATA, DataProcessor.SerializePlayerTurnData(playerTurn))); return(true); }
public static DataPlayerTurn DeserializePlayerTurnData(string aJSON_STRING, string aClientID) { DataPlayerTurn lData = new DataPlayerTurn(); //Client must send object with empty ClientID field //ClientID gets fill here manually lData = JsonConvert.DeserializeObject <DataPlayerTurn>(aJSON_STRING); lData.ClientID = aClientID; return(lData); }
public static string SerializePlayerTurnData(DataPlayerTurn playerTurn) { return(JsonConvert.SerializeObject(playerTurn)); }