/**
 * Represents a more advanced Monopoly player
 */
public class MonopolyPlayer {
  
  private String name;            // this MonopolyPlayer's name
  private double cashOnHand;      // this MonopolyPlayer's money
  private  int numBuildings;      // number of buildings owned by this MonopolyPlayer; 
                                  // all MonopolyPlayers start with no buildings
  private boolean male;           // is this MonopolyPlayer a male? All MonopolyPlayers 
                                  // are created female 
  private static int numPlayers= 0;   // number of MonopolyPlayers created by this class

  /**
   * Set the cash this object has
   */
  public void addCash ( double cash ) {
   cashOnHand= cashOnHand + cash;
  }
  
  /**
   * Constructor. Initializes cashOnHand to 500.00
   */
  public MonopolyPlayer() {
    cashOnHand= 500.00;
    numBuildings= 0;
    male= false;
    numPlayers= numPlayers + 1;  // COMPARE with similar operation in next method
  }
  
  /**Constructor. Sets balance of this MonopolyPlayer to parameter
   */
  public MonopolyPlayer( double initialCash) { 
    cashOnHand= initialCash;
    numBuildings= 0;
    male= false;
    numPlayers= numPlayers++;  // NOTE that this is exactly the same operation as the one above
                               // it adds 1 to numPlayers - just a shorthand way to do it.
  }
  
  /**
   * Return the amount of money this MonopolyPlayer has
   */
  public double getBalance() {
    return cashOnHand;
  }
  
  /**
   * Changes the sex of this MonopolyPlayer (male to female,
   * and vice versa; kind of like a universal sex change operation 
   * - a reminder: these are imaginary players.)
   */
  public void changeSex() {
    //male= ????;
  }
  
  /**
   * Return the number of buildings this MonopolyPlayer owns
   */
  public int buildingsOwned() {
    return numBuildings;
  }
  
  /**
   * Return the number of MonopolyPlayers created from this class
   */
  public static int getNumMPs() {
    return numPlayers;
  }
  /**
   * Gives this MonopolyPleyer the given number of buidings (on top of
   * what they already had.
   */
  public void addBuildings( int b) { // !!!Not very useful variableName !!!
    numBuildings = numBuildings + b;
  }
  
  /**
   * Return true if this MonopolyPlayer is male,
   * false otherwise.
   */
  public boolean isMale() {
    return male;
}
  /**
   * Return true if this MonopolyPlayer has more than 50,000 
   * dollars (or perhaps other units - we never specified) or
   * if they have seven or more buildings.
   */
  public boolean isRich() {
    return //????;
  }
}

