Méthode | Description | |
---|---|---|
BuildCity ( |
Let a player upgrade a settlement to a city If the player doesn't have enough resources to build a city a InsufficientResourcesException is thrown If the player tries to build at a position where he doesn't have a settlement a IllegalBuildPosition is thrown If the player doesn't have any more city pieces left to place a IllegalActionException is thrown The required resources are taken from the player and placed back at the resource bank The settlement previously on the location is given back to the player
|
|
BuildFirstRoad ( |
Let a player build a road without a requirement for connectivity and free of charge The road may not be placed on top of another road Connectivity with previously placed settlement should be controlled elsewhere (in StartActions.cs)
|
|
BuildFirstSettlement ( |
Let a player build a settlement without a requirement for connectivity and free of charge The settlement still has to follow the distance rule and cannot be placed on top of another building
|
|
BuildRoad ( |
Let a player build a road If the player doesn't have enough resources to build a road an InsufficientResourcesException is thrown If the player tries to build at a position not connected to another road, settlement or city an IllegalBuildPositionException is thrown If the player doesn't have any more road pieces left to place an IllegalActionException is thrown
|
|
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)
|
|
CompleteTrade ( |
||
DrawDevelopmentCard ( |
Let a player draw a development card If the player doesn't have enough resources a InsufficientResourcesException is thrown If the development card stack is empty a NoMoreCardsException is thrown Resources to pay for the card are removed from the player hand and returned to the resource bank
|
|
GetBoard ( ) : IBoard |
Returns the current game board held by this controller.
|
|
PlayKnight ( |
Let a player play a knight development card If the player doesn't have a knight on his hand a InsufficientResourcesException is thrown A knight is removed from the players hand The largest army special card is relocated if playing this knight causes it to be
|
|
PlayMonopoly ( |
Let a player play a Monopoly development card If the player doesn't have a Monopoly card on his hand a InsufficientResourcesException is thrown All resources of the given type is removed from players hands and all given to the playing player
|
|
PlayRoadBuilding ( |
Let a player play a road building development card If the player doesn't have a RoadBuilding card on his hand a InsufficientResourcesException is thrown If the player doesn't have any road pieces left a IllegalActionException is thrown If the player tries to place a road at a position where a road is already present a IllegalBuildPositionException is thrown If the player only has one road piece left, the position to place it must be passed as road1Tile1, road1Tile2 (the others are ignored)
|
|
PlayYearOfPlenty ( |
Let a player play a year of plenty development card If the player doesn't have a YearOfPlenty card on his hand a InsufficientResourcesException is thrown If the resource bank doesn't have enough cards to fulfill the request a NoMoreCardsException is thrown
|
|
ProposeTrade ( |
||
StartGame ( IAgent agents, int boardSeed, int diceSeed ) : int | ||
StartGame ( IAgent agents, int boardSeed, int diceSeed, bool visual, bool logToFile ) : int |
Start the game. This method will run for the length of the game and returns the id of the winner
|
|
TradeBank ( |
Trade resources with the bank If no harbor is owned trading is 4 : 1 If a general harbor is owned trading is 3 : 1 Special harbors trade a specific resource 2 : 1
|
Méthode | Description | |
---|---|---|
CurrentGamestate ( ) : |
||
CurrentGamestate ( int playerId ) : |
||
GameLoop ( ) : int |
Executes the game, each player turn by turn until a player wins
|
|
GetPlayableDevelopmentCards ( |
Get a list of playable development cards for a given player Newly bought development cards cannot be played in the same round
|
|
GetPoints ( |
Find out how many victory points a given player has Points are counted as: Settlements give 1 point each Cities give 2 points each Victory point development cards give 1 point each Having the largest army or the longest road give 2 points each.
|
|
GetResource ( |
Give a player an amount of some resource If there are no more cards in the pile an NoMoreCardsException is thrown
|
|
HandOutResources ( int roll ) : void |
Hand out resources to players according to a roll Gives resources to players with buildings on tiles with a number corresponding to the roll and only if the tile doesn't have the robber. If there is not enough resources of a kind in the bank so that all player who shall receive, can get the amount they are allowed to, none of that kind are dealt (see rules p. 8 top)
|
|
HasWon ( |
Find out if a given player has won (if his number of victory points is over or equal to 10)
|
|
Log ( |
||
MoveRobber ( |
Let a player move the robber to a new location and draw a random card from a player with a building on the tile If the agent moves the robber to a water tile or the tile that it was already on, nothing will happen If the agent tries to draw a card from a unaffected player, no cards will be drawn
|
|
NextTurn ( ) : void |
Increment the turn variable modulo the number of players
|
|
PayResource ( |
Let a given player pay an amount of a resource to the bank
|
|
PlaceStarts ( ) : void |
Let the players place their starting settlements and roads and receive resources from all neighboring tiles from the last placed settlement (rules p. 7 top)
|
|
PopulateDevelopmentCardStack ( ) : void |
Populate and shuffle the development card stack according to the rules (rules p. 2 - Game Contents)
|
|
PrevTurn ( ) : void |
Decrement the turn variable, if it goes below 0, wrap around
|
|
RoadConnected ( IBoard board, Edge edge, int playerId ) : bool |
Figure out if a given edge on the board is connected to a given players road in some end
|
|
RollDice ( ) : int |
Roll two d6 using the seeded random number generator and get the sum
|
|
ShowScores ( ) : void | ||
StartGUI ( ) : void | ||
TakeTurn ( |
Executes all parts of a players turn 1. Allow the play of a development card before the dice are rolled 2. Roll the dice, hand out resources to all players, and move the robber if roll is 7 3. Allow all actions according to the rules
|
|
UpdateLongestRoad ( ) : void |
Update the player who has the longest road to be able to determine who has how many points
|
public BuildCity ( |
||
player | The player upgrading to a city | |
intersection | The intersection to upgrade to a city on | |
Résultat |
public BuildFirstRoad ( |
||
player | The player placing the road | |
edge | Edge | The edge to build the road on |
Résultat |
public BuildFirstSettlement ( |
||
player | The player placing the settlement | |
intersection | The intersection to build a settlement on | |
Résultat |
public BuildRoad ( |
||
player | The player building a road | |
edge | Edge | The to build a road on |
Résultat |
public BuildSettlement ( |
||
player | The player building a settlement | |
inter | The intersection to build a settlement on | |
Résultat |
public CompleteTrade ( |
||
player | ||
playerid | int | |
Résultat |
public DrawDevelopmentCard ( |
||
player | The player drawing a development card | |
Résultat |
public PlayKnight ( |
||
player | The player playing a knight | |
Résultat |
public PlayMonopoly ( |
||
player | The player playing the monopoly development card | |
resource | Resource | The resource to get monopoly on |
Résultat |
public PlayRoadBuilding ( |
||
player | The player that plays the RoadBuilding development card | |
firstRoad | Edge | The first edge to build a road on |
secondRoad | Edge | The second edge to build a road on |
Résultat |
public PlayYearOfPlenty ( |
||
player | The player playing the year of plenty development card | |
resource1 | Resource | The type of resource for the first card |
resource2 | Resource | The type of resource for the second card |
Résultat |
public ProposeTrade ( |
||
player | ||
give | List |
|
take | List |
|
Résultat | ITrade>.Dictionary |
public StartGame ( IAgent agents, int boardSeed, int diceSeed ) : int | ||
agents | IAgent | |
boardSeed | int | |
diceSeed | int | |
Résultat | int |
public StartGame ( IAgent agents, int boardSeed, int diceSeed, bool visual, bool logToFile ) : int | ||
agents | IAgent | The competing agents (The order in which they are submitted is irrelevant) |
boardSeed | int | The seed for the board generator, used to shuffle development cards, and for drawing a random card after moving the robber |
diceSeed | int | The seed for the dice |
visual | bool | True if the game should be displayed visually |
logToFile | bool | |
Résultat | int |
public TradeBank ( |
||
player | The player wanting to trade | |
giving | Resource | The resource that the player want to give |
receiving | Resource | The resource that the player want to receive |
Résultat |