Exemple #1
0
        public Game()
        {
            Factory.Instance.CreateExtensions().AppInit();

            _model = new Model();

            _view = Factory.Instance.CreateView();
            _protocol = Factory.Instance.CreateTTTProtocol();
        }
Exemple #2
0
        public void Init(Model model)
        {
            _generalField = new UIGameTTT(model)
                                {
                                    FormNewGame = CallBackNewGame,
                                    FormExit = CallBackExit,
                                    FormSetCellState = CallBackSetCellState
                                };

            _newCameForm = new UINewGame();
            Application.Run(_generalField);
        }
Exemple #3
0
 private void EndGame(Model.CheckStateResult cellsState)
 {
     if (cellsState == Model.CheckStateResult.ThisGamerWin)
     {
         _protocol.PostYouLoser();
         _view.Say(Resources.UIGameTTT_You_Win);
     }
     if (cellsState == Model.CheckStateResult.OtherGamerWin)
     {
         _view.Say(Resources.UIGameTTT_You_Miss);
     }
     if (cellsState == Model.CheckStateResult.Draw)
     {
         _view.Say(Resources.UIGameTTT_Drawn);
     }
     _protocol.CloseGame();
     _model.EmptyGame();
     _view.Repaint();
 }
Exemple #4
0
 public UIGameTTT(Model model)
 {
     EModel = model;
     InitializeComponent();
 }
Exemple #5
0
 public View(Model model)
 {
     _model = model;
 }