All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class busrider.PlayerView

java.lang.Object
   |
   +----busrider.PlayerView

public class PlayerView
extends Object
This immutable class represents a view of a player. It provides read-only access to a Player object. One can see most or all properties of the player, depending on the "self" flag, but alter nothing.


Constructor Index

 o PlayerView(Player, boolean)
creates a PlayerView.

Method Index

 o getCash()
returns the player's cash, if this PlayerView was delivered to Strategy.startGame(); otherwise returns 0.
 o getCurrentRoute()
returns the player's current Route.
 o getDestination()
returns the player's destination.
 o getIndex()
returns the player's index.
 o getLocation()
returns a copy of the player's location.
 o getName()
returns the player's name.
 o getOrigin()
returns the player's terminus of origin.
 o isBankrupt()
indicates whether the player is bankrupt.
 o isFast()
indicates whether the player is fast (throws three dice).
 o isWealthy()
indicates whether the player has at least Game.WEALTHY_CASH cash.

Constructors

 o PlayerView
 public PlayerView(Player pl,
                   boolean self)
creates a PlayerView.

Methods

 o getName
 public String getName()
returns the player's name.

 o getIndex
 public int getIndex()
returns the player's index.

 o getCash
 public int getCash()
returns the player's cash, if this PlayerView was delivered to Strategy.startGame(); otherwise returns 0.

 o isWealthy
 public boolean isWealthy()
indicates whether the player has at least Game.WEALTHY_CASH cash.

 o isBankrupt
 public boolean isBankrupt()
indicates whether the player is bankrupt.

 o isFast
 public boolean isFast()
indicates whether the player is fast (throws three dice).

 o getOrigin
 public Junction getOrigin()
returns the player's terminus of origin.

 o getLocation
 public Location getLocation()
returns a copy of the player's location.

 o getDestination
 public Junction getDestination()
returns the player's destination. But returns null if the player is at a terminus and hasn't selected his next destination.

 o getCurrentRoute
 public Route getCurrentRoute()
returns the player's current Route.


All Packages  Class Hierarchy  This Package  Previous  Next  Index