TOC
- prev
- next
- javadoc tree
A Player is a player of the BusRider game. He acts under the direction of a Strategy (or the conductor, whenever the Strategy fails to direct).
A player has:
A player is represented by the Player class, but Player objects are not accessible to a Strategy.
A Strategy can see how many players there are
(Game.getPlayerQuan()
), and can see many properties of a
player through the
PlayerView class,
obtainable by Game.getPlayerView()
.
The name is the class-name of the Strategy which controls the player.
The index is a unique non-negative integer; players are indexed sequentially from zero. This player-index is used frequently in the Strategy methods.
A Strategy can see a player's name and index, and can tell the index of the player it controls.
Each player begins with Game.INITIAL_CASH
dollars.
The first player to have Game.WINNING_CASH
dollars at the end of his delivery-making turn, wins.
If a player has at least Game.WEALTHY_CASH
dollars,
he is considered Wealthy.
If a player, after paying fares, has a negative amount of cash and nothing to sell, he becomes Bankrupt. Bankrupted players do not participate further in the game.
A Strategy cannot see other player's cash. But a Strategy can see whether a player is Bankrupt, and whether a player is Wealthy. Nevertheless, clever Strategies can keep track of other players' activities, and can usually deduce to whom fares are paid: thereby obtaining an excellent estimate of a player's cash.
At any time, a player is somewhere on the board. That location is either somewhere along a Segment of a Route, or at an intersection of Segments (a Junction). A player's location will generally change each turn, although it is possible that he return to his starting point.
A location is represented by the Location class.
Each turn, a player proceeds from his Origin to his Destination. On arrival, he collects a cash payout, and that Destination becomes the Origin for the next trip. At the start of each delivery, two Termini are randomly chosen, and the Strategy picks one of them.
A Strategy can see the Origin and Destination of each player.
A player is either slow or fast. This affects the number of dice thrown each turn, and therefore the distance travelled each turn.
A Strategy can see the speed of each player.
At the start of a delivery, a player has no current Route.
Whenever a player travels along a Segment, that Segment's Route becomes the player's current Route. (This may or may not effect a change.)
Whenever the player's current Route changes, he pays a fare to the owner, or to the bank if unowned. (But fares paid to oneself are ignored.)
A Strategy can see the current Route of each player.
A player starts with no owned Routes.
A player can purchase Routes, from time to time.
A player is required to sell a Route, whenever he can't otherwise pay a fare. (Generally, Strategies should try to avoid that: but I can imagine situations where a Player should purchase, even though a sale must be made later.)
A Strategy can see who owns each Route.
TOC
- prev
- next
- javadoc tree