Class Facility

java.lang.Object
model.facility.Facility
All Implemented Interfaces:
Serializable, Buildable
Direct Known Subclasses:
Education, EffectualFacility, Road

public abstract class Facility extends Object implements Buildable, Serializable
See Also:
  • Field Details

    • oneTimeCost

      protected int oneTimeCost
    • maintenanceFee

      protected int maintenanceFee
    • coordinate

      protected Coordinate coordinate
    • dimension

      protected Dimension dimension
  • Constructor Details

    • Facility

      public Facility(int oneTimeCost, int maintenanceFee, Coordinate coordinate, Dimension dimension)
  • Method Details

    • isConnected

      public boolean isConnected()
      Description copied from interface: Buildable
      if buildable is connected to master road
      Specified by:
      isConnected in interface Buildable
      Returns:
      true id connected
    • resetConnected

      public void resetConnected(Buildable connectingPoint, Buildable[][] map)
      Resets the connected property with the current possibility of connection
      Parameters:
      connectingPoint - master road
      map - map of city
    • setConnected

      public void setConnected(Buildable connectingPoint, Buildable[][] map)
    • getOneTimeCost

      public int getOneTimeCost()
      Description copied from interface: Buildable
      Every buildable cost some when built.
      Specified by:
      getOneTimeCost in interface Buildable
      Returns:
      the costs.
    • getMaintenanceFee

      public int getMaintenanceFee()
    • getCoordinate

      public Coordinate getCoordinate()
      Specified by:
      getCoordinate in interface Buildable
      Returns:
      the coordinate of the buildable
    • getDimension

      public Dimension getDimension()
      Specified by:
      getDimension in interface Buildable
      Returns:
      the dimension of the buildable
    • toString

      public String toString()
      Overrides:
      toString in class Object