public TaskInfo Execute(string details) { Mazes.MazeProgram.Multiplayer(details); Mazes.IDataClass data = Mazes.MazeProgram.GetData(); JavaScriptSerializer serial = new JavaScriptSerializer(); string json = serial.Serialize(data); string name = data.GetMazeName(); bool isFirst = name.Contains("player1"); TaskInfo info = new TaskInfo(json); if (isFirst) { info.Set_Multi_Info((int)MultiplayInfo.First_Request); } else { info.Set_Multi_Info((int)MultiplayInfo.Second_Request); } info.SetMultGame(data.GetName()); /*bool isFirst = MazeButNot.Multiplayer.IsFirst (); * if (isFirst) { * Console.WriteLine ("is first"); * info.Set_Multi_Info ((int) MultiplayInfo.First_Request); * } else { * Console.WriteLine ("is second"); * info.Set_Multi_Info ((int) MultiplayInfo.Second_Request); * } * info.SetMultGame ("blerrrrf"); // Get name of multiplayer game */ return(info); }
public TaskInfo Execute(string details) { // details stores the name of the game to close TaskInfo info = new TaskInfo(""); // we're not going to print anything for the close command info.Set_Multi_Info((int)MultiplayInfo.Close_Request); info.SetMultGame(details); return(info); }
public TaskInfo Execute(string details) { Mazes.MazeProgram.Close(details); // delete the game in the maze databases TaskInfo info = new TaskInfo(""); // we're not going to print anything for the close command info.Set_Multi_Info((int)MultiplayInfo.Close_Request); info.SetMultGame(details); // details stores the name of the game to close return(info); }
public TaskInfo Execute(string details) { Mazes.MazeProgram.Multiplayer(details); Mazes.IDataClass data = Mazes.MazeProgram.GetData(); JavaScriptSerializer serial = new JavaScriptSerializer(); string json = serial.Serialize(data); string name = data.GetMazeName(); bool isFirst = name.Contains("player1"); TaskInfo info = new TaskInfo(json); if (isFirst) { info.Set_Multi_Info((int)MultiplayInfo.First_Request); } else { info.Set_Multi_Info((int)MultiplayInfo.Second_Request); } info.SetMultGame(data.GetName()); return(info); }