TOC
- prev
- next
- javadoc tree
3.2. Turns
Sequence of Turns
The BusRider Applet lists the Strategies involved in the game, and
each is bound to a player.
The players take turns in the listed order.
(But Bankrupted players are skipped.)
In consecutive games, the players also take turns going first.
Details of a turn
A turn of a player/Strategy proceeds as follows:
- The conductor calls the Strategy's
beginTurn
method.
- If the player has no Destination, the conductor picks two, and calls
the Strategy's
chooseDestination
method.
The Strategy returns one of them, which becomes the player's
Destination; otherwise the conductor picks the first one.
- The conductor rolls two dice for the player, or three if he has a
Right-of-Way.
The total of all dice is the player's roll.
- Until the player reaches his Destination or exhausts his roll:
- If the player is at a Junction: the conductor calls the
Strategy's
chooseSegment
method, to see which
Segment to follow.
If the Strategy does not reply with a Segment which abuts that
Junction, the conductor chooses such a Segment.
The player is started along that Segment.
- If that Segment's Route is not owned by the player, and is
different than the previously-travelled Route, the conductor
pays a fare to the Route's owner or to the bank.
(The player's cash may go negative, here.)
If a fare is paid to an owner, the conductor credits the owner's
cash, then calls that Strategy's
receiveFare
method.
- If the player is within a Segment, he moves in the same
direction as before, until reaching the end or exhausting the
roll.
The roll is decremented by the distance moved.
If the player reaches his Destination, any remainder of the roll
is discarded.
- If the player has arrived at his Destination:
- The conductor looks-up the payoff for the delivery, and credits
the player's cash.
- The player's Destination becomes his Origin, and the player no
longer has a Destination.
- The conductor calls the Strategy's
youArrived
method, to see what to purchase.
- If the Strategy returns a valid Purchase object (see below), the
player purchases that item, and his cash is debited.
The conductor then calls each Strategy's
playerIsFast
or transferRoute
method,
as appropriate.
- While the player has negative cash and owns some Routes:
- The conductor calls the Strategy's
youMustSell
method.
If the Strategy does not return a Route which is owned by the
player, the conductor picks such a Route.
The player sells that Route to the bank, and the purchase price
is credited.
- The conductor then calls each Strategy's
transferRoute
method.
- If the player still has negative cash, he is Bankrupted.
The conductor calls the Strategy's
youAreBroke
method.
- If the player has no destination (and has therefore just arrived at
one), the conductor notes whether the player has enough cash to
win.
- The conductor calls the Strategy's
endTurn
method.
- If the player has won, or if all players are Bankrupt, the conductor
calls each Strategy's
endGame
method.
Purchases
A Right-of-Way purchase is valid if:
- the player has enough cash to buy it, and
- the player does not already have it.
So, you can't stupidly buy a Right-of-Way twice.
A Route purchase is valid if:
- the player has enough cash to buy it, and
- no player already owns the Route.
A Purchase object is valid if it is a valid Right-of-Way purchase, or
a valid Route purchase.
A player may make a purchase only after arriving at a Destination,
and then he may purchase only one thing.
A player can spend his cash down to zero.
This is legal, but may be a poor idea.
If the player must pay a fare before collecting a fare, or reaching
his next destination, he will have to sell a Route.
A player cannot spend his cash below zero, even if he has a Route
that he wants to sell.
Sales
A player cannot sell a Right-of-Way.
A player can sell only when his cash falls below zero; and that can
happen only after paying a fare.
When selling, a player may sell any Route that he owns.
When sold, a Route is sold to the bank, never to another player.
The sale price is the same as the purchase price.
TOC
- prev
- next
- javadoc tree