Пример #1
0
        public Game(MainPlayer mainPlayer
                    , RobotPlayer robotPlayer
                    , EmptyUserPlayer emptyCellsAsPlayer
                    , DataProvider dataProvider)
        {
            _actionsHistory    = new Stack <HistoryMove>();
            MainPlayer         = mainPlayer;
            RobotPlayer        = robotPlayer;
            EmptyCellsAsPlayer = emptyCellsAsPlayer;
            _dataProvider      = dataProvider;

            NextMoveSide = Side.White;
        }
Пример #2
0
        public Game CreateGame()
        {
            DataProvider    newDataProvider     = _dataProvider.Clone();
            MainPlayer      newPlayerOne        = MainPlayer.Clone(newDataProvider);
            RobotPlayer     newViewPlayerTwo    = RobotPlayer.Clone(newDataProvider);
            EmptyUserPlayer newEmptyCellsPlayer = EmptyCellsAsPlayer.Clone(newDataProvider);
            var             newGameModel        = new Game(newPlayerOne, newViewPlayerTwo, newEmptyCellsPlayer, newDataProvider)
            {
                NextMoveSide = NextMoveSide
            };

            newGameModel.ReCalculateNeighborsAndPaths();
            return(newGameModel);
        }