Ejemplo n.º 1
0
        public void ReCalculateNeighborsAndPaths()
        {
            EmptyCellsAsPlayer.CalculateNeighbors();
            MainPlayer.CalculateNeighbors();
            RobotPlayer.CalculateNeighbors();

            MainPlayer.CalculateAvailablePaths();
            RobotPlayer.CalculateAvailablePaths();
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
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);
        }