Beispiel #1
0
        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);
        }
Beispiel #2
0
        public TaskInfo Execute(string details)
        {
            int    space   = details.IndexOf(' ');
            string name    = details.Substring(0, space);
            string typeStr = details.Substring(space + 1);
            int    type    = Int32.Parse(typeStr);

            Mazes.MazeProgram.SolveMaze(name, type);
            Mazes.IDataClass     data       = Mazes.MazeProgram.GetData();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            string   json = serializer.Serialize(data);
            TaskInfo info = new TaskInfo(json);

            return(info);
        }
Beispiel #3
0
        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);
        }