Example #1
0
 public Task(string t, string d, IModel m, TaskHandler h)
 {
     type        = t;
     details     = d;
     multi_manag = m.Get_Multi_Manager();
     handler     = h;
 }
Example #2
0
 public MyModel(IPresenter p)
 {
     this.p       = p;
     this.options = new Dictionary <string, ICommandable> ();
     options.Add("generate", new GenerateCommand());
     options.Add("solve", new SolveCommand());
     options.Add("multiplayer", new MultiplayCommand());
     options.Add("play", new PlayCommand());
     options.Add("close", new CloseCommand());
     multi_manag = new MultiplayManager();
 }
Example #3
0
        public void MultiplayReady(object source, MultiplayArgs a)
        {
            MultiplayManager manag = (MultiplayManager)source;

            if (a.t1 == this || a.t2 == this)
            {
                manag.MultiplayReady -= this.MultiplayReady;
                string json = info.GetJson();
                FinishedTaskEventArgs finalInfo = new FinishedTaskEventArgs(json, false);
                Finished(this, finalInfo);
            }
        }
Example #4
0
        public void EndGame(object source, MultiplayArgs a)
        {
            MultiplayManager manag = (MultiplayManager)source;

            if (a.t1 == this || a.t2 == this)
            {
                manag.PlayerMoved -= this.PlayerMoved;
                manag.EndGame     -= this.EndGame;
                FinishedTaskEventArgs info = new FinishedTaskEventArgs("", true);
                Finished(this, info);
            }
        }