public Game() { Factory.Instance.CreateExtensions().AppInit(); _model = new Model(); _view = Factory.Instance.CreateView(); _protocol = Factory.Instance.CreateTTTProtocol(); }
public void Init(Model model) { _generalField = new UIGameTTT(model) { FormNewGame = CallBackNewGame, FormExit = CallBackExit, FormSetCellState = CallBackSetCellState }; _newCameForm = new UINewGame(); Application.Run(_generalField); }
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(); }
public UIGameTTT(Model model) { EModel = model; InitializeComponent(); }
public View(Model model) { _model = model; }