BuildSettlement() 공개 메소드

Let a player build a settlement If the player doesn't have enough resources to build a settlement a InsufficientResourcesException is thrown If the player tries to build too close to another building, or not connected to a road a IllegalBuildPosition is thrown If the player doesn't have any more settlement pieces left to place a IllegalActionException is thrown The required resources are taken from the player and placed back at the resource bank If the settlement is placed at a harbor, the harbor can be used immediately (rules p. 7 - footnote 12)
public BuildSettlement ( Player player, Intersection inter ) : GameState
player Player The player building a settlement
inter AIsOfCatan.API.Intersection The intersection to build a settlement on
리턴 GameState
예제 #1
0
        //Building

        public GameState BuildSettlement(Intersection intersection)
        {
            if (!valid)
            {
                throw new IllegalActionException("Tried to perform an action on an invalid GameAction");
            }
            if (!isAfterDieRoll)
            {
                throw new IllegalActionException("Tried to build before the die roll");
            }
            return(controller.BuildSettlement(player, intersection));
        }