/**
 * a clear, well-ventilated place to breathe
 */
public class Chamber {
  
  /**
   * where this chamber is
   */
  private String address;
  
  /**
   * we use airFillShop
   */
  private AirFillShop airFillShop;
  /**
   * Amount of air at Standard Temperature and
   * Pressure (STP), in litres
   */
  private int airSupply= 0;
  
  /**
   * create a new chamber at address, using
   * aFS to buy air.
   */
  public Chamber(String address, AirFillShop aFS) {
    this.address= address;
    airFillShop= aFS;
  }
  
  /**
   * create a new chamber at address.
   */
  public Chamber(String address) {
    this.address= address;
  }
  
  /**
   * return our address
   */
  public String getAddress() {
    return address;
  }
  
  /**
   * increase or decrease air supply by
   * airChange
   */
  public void adjustAirBy(int airChange) {
    airSupply  += airChange;
  }
  
  /**
   * how much air we have
   */
  public int getAvailableAir() {
    return airSupply;
  }
  
  /**
   * set our air fill shop to aFS
   */
  public void setNearestAirFillShop(AirFillShop aFS) {
    airFillShop= aFS;
  }
  
  /**
   * what's the nearest air fill shop?
   */
  public AirFillShop getNearestAirFillShop(){
    return airFillShop;
  }
  
  /**
   * This chamber's address, air supply in litres,
   * and air fill shop
   */
  public String toString() {
    String result= "Chamber: ";
    result += address + ", ";
    result += "Air (in litres): " + airSupply;
    result += ", Air fill shop: ";
    result += getNearestAirFillShop().getName() + ".";
    return result;
  }
}