示例#1
0
 public TicTacToePresenter(TicTacToeForm ticTacToeForm)
 {
     _gameCanvases    = EnumUtil.GetListOfEnumElement <CanvasType>("Matrix");
     _ticTacToeForm   = ticTacToeForm;
     _canvasContainer = new CanvasContainer();
     _network         = new ActivationNetwork(new SigmoidFunction(2), 100, 14, 2);
     new BackPropagationLearning(_network);
     _pen                          = new Pen(Color.Black, 5);
     _crossDesignator              = new CrossDesignator();
     _network                      = (ActivationNetwork)Network.Load("Net.bin");
     _gameUtil                     = new GameUtil();
     _computerPlayer               = new ComputerPlayer(_gameUtil, _gameCanvases);
     _board                        = new GameBoard(_gameCanvases);
     _game                         = new Game(_gameUtil, _board, _computerPlayer);
     _ticTacToeForm.DrawAction    += Draw;
     _ticTacToeForm.LearnAction   += ExecuteLearnAction;
     _ticTacToeForm.CrossAction   += ExecuteCrossAction;
     _ticTacToeForm.CircleAction  += ExecuteCircleAction;
     _ticTacToeForm.ClearAction   += ExecuteClearAction;
     _ticTacToeForm.CopyAction    += ExecuteCopyAction;
     _ticTacToeForm.TestAction    += ExecuteTestAction;
     _ticTacToeForm.NewGameAction += ExecuteNewGameAction;
     _ticTacToeForm.PlayAction    += ExecutePlayAction;
     _ticTacToeForm.BackAction    += ExecuteBackAction;
     _lastModifiedCanvas           = CanvasType.Matrix11;
     _paintFactory                 = new PaintFactory(_pen, _crossDesignator);
 }
 public DrawCrossCommand(Pen pen, CrossDesignator crossDesignator)
 {
     _pen             = pen;
     _crossDesignator = crossDesignator;
 }
示例#3
0
 public PaintFactory(Pen pen, CrossDesignator crossDesignator)
 {
     _pen             = pen;
     _crossDesignator = crossDesignator;
 }