Exemplo n.º 1
0
        public void CanTakePlantation()
        {
            var action = new TakePlantation {
                TileIndex = 0,
            };

            CanExecuteActionOnce(action, RoleOwner);
        }
Exemplo n.º 2
0
        public void TakePlantationMovesPlantationToPlayer()
        {
            var action = new TakePlantation {
                TileIndex = 1,
            };

            CanExecuteActionOnce(action, RoleOwner);
            Assert.Equal(2, RoleOwner.Tiles.Count());
            var player = Game.GetNextPlayerTo(RoleOwner);

            Assert.Throws <GameException>(() => CanExecuteActionOnce(action, player));
            Assert.Single(player.Tiles);
        }
Exemplo n.º 3
0
        public void PlantationsAreRefilledOnCleanUp()
        {
            var action = new TakePlantation {
                TileIndex = 1,
            };

            CanExecuteActionOnce(action, RoleOwner);
            Role.CleanUp();
            var player = Game.GetNextPlayerTo(RoleOwner);

            player.SelectRole(Role, Game);
            CanExecuteActionOnce(action, player);
        }
Exemplo n.º 4
0
        public void CanUseHospice()
        {
            var player  = GetPlayerWithoutPrivilege();
            var hospice = new Hospice();

            hospice.AddWorker(new Colonist());
            player.Build(hospice);
            var action = new TakePlantation {
                TileIndex = 2
            };

            CanExecuteActionOnce(action, player);
            Assert.Equal(2, player.Tiles.Count());
            Assert.NotNull(player.Tiles[1].Worker);
        }
Exemplo n.º 5
0
        private void ExecuteTakePlantation(TakePlantation takePlantation, IPlayer player, string phase)
        {
            var plantation = Game.PlantationDeck.DrawOneVisible(takePlantation.TileIndex);

            if (player.Buildings.ContainsWorkingOfType <Hospice>() && Game.Colonists.Count > 0)
            {
                var colonist = Game.Colonists.Pop();
                plantation.AddWorker(colonist);
            }

            player.Tiles.Add(plantation);

            if (phase == SelectTileOrHaciendaPhase && CanUseHacienda(player))
            {
                SetPlayerPhase(player, HaciendaPhase);
            }
            else
            {
                SetPlayerPhase(player, EndedPhase);
            }
        }