public JSON.TicTacToe ToStruct() { JSON.TicTacToe r = new JSON.TicTacToe(); r.Cross = cross.Id; r.Circle = circle.Id; r.Channel = channel.Id; r.Game = game; r.IsCircleTurn = isCircleTurn; return(r); }
public static TicTacToe ToClass(JSON.TicTacToe t, DiscordClient client) { /*Console.WriteLine(t.Cross); * Console.WriteLine(t.Circle); * Console.WriteLine(t.Channel);*/ //Console.WriteLine("d"); Channel c = client.GetChannel(t.Channel); /*if (c != null) * Console.WriteLine(c.Id); * else * Console.WriteLine("is null");*/ TicTacToe ttt = new TicTacToe(c.GetUser(t.Cross), c.GetUser(t.Circle), c); //Console.WriteLine("f"); ttt.game = t.Game; //Console.WriteLine("g"); return(ttt); }