|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.structure.building.Building
public class Building
The Building class is a settlement's building.
| Field Summary | |
|---|---|
protected double |
basePowerDownPowerRequirement
|
protected double |
basePowerRequirement
|
protected double |
facing
|
static String |
FULL_POWER
|
protected List<Function> |
functions
|
protected double |
length
|
protected MalfunctionManager |
malfunctionManager
|
protected BuildingManager |
manager
|
protected String |
name
|
static String |
NO_POWER
|
static String |
POWER_DOWN
|
protected String |
powerMode
|
protected double |
width
|
protected double |
xLoc
|
protected double |
yLoc
|
| Constructor Summary | |
|---|---|
protected |
Building()
Empty constructor. |
|
Building(BuildingTemplate template,
BuildingManager manager)
Constructs a Building object. |
|
Building(String name,
double xLoc,
double yLoc,
double facing,
BuildingManager manager)
Constructs a Building object. |
| Method Summary | |
|---|---|
int |
compareTo(Building o)
Compares this object with the specified object for order. |
void |
destroy()
Prepare object for garbage collection. |
Collection<Person> |
getAffectedPeople()
Gets a collection of people affected by this entity. |
BuildingManager |
getBuildingManager()
Gets the building's building manager. |
double |
getFacing()
Gets the object's facing. |
double |
getFullPowerRequired()
Gets the power this building currently requires for full-power mode. |
Function |
getFunction(String functionName)
Gets a function if the building has it. |
Inventory |
getInventory()
Gets the inventory associated with this entity. |
double |
getLength()
Gets the object's length. |
MalfunctionManager |
getMalfunctionManager()
Gets the entity's malfunction manager. |
String |
getName()
Gets the building's name. |
double |
getPoweredDownPowerRequired()
Gets the power the building requires for power-down mode. |
String |
getPowerMode()
Gets the building's power mode. |
double |
getWidth()
Gets the object's width. |
double |
getXLocation()
Gets the X location of the object from the local area's center point. |
double |
getYLocation()
Gets the Y location of the object from the local area's center point. |
boolean |
hasFunction(String functionName)
Checks if a building has a particular function. |
void |
removeFunctionsFromSettlement()
Remove the building's functions from the settlement. |
void |
setPowerMode(String powerMode)
Sets the building's power mode. |
void |
timePassing(double time)
Time passing for building. |
String |
toString()
String representation of this building. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String FULL_POWER
public static final String POWER_DOWN
public static final String NO_POWER
protected BuildingManager manager
protected String name
protected double width
protected double length
protected double xLoc
protected double yLoc
protected double facing
protected String powerMode
protected MalfunctionManager malfunctionManager
protected List<Function> functions
protected double basePowerRequirement
protected double basePowerDownPowerRequirement
| Constructor Detail |
|---|
public Building(BuildingTemplate template,
BuildingManager manager)
template - the building template.manager - the building's building manager.
BuildingException - if building can not be created.
public Building(String name,
double xLoc,
double yLoc,
double facing,
BuildingManager manager)
name - the building's name.xLoc - the x location of the building in the settlement.yLoc - the y location of the building in the settlement.facing - the facing of the building (degrees clockwise from North).manager - the building's building manager.
BuildingException - if building can not be created.protected Building()
| Method Detail |
|---|
public boolean hasFunction(String functionName)
functionName - the name of the function.
public Function getFunction(String functionName)
functionName - the name of the function.
BuildingException - if building doesn't have the function.public void removeFunctionsFromSettlement()
public BuildingManager getBuildingManager()
public String getName()
getName in interface Malfunctionablepublic double getWidth()
LocalBoundedObject
getWidth in interface LocalBoundedObjectpublic double getLength()
LocalBoundedObject
getLength in interface LocalBoundedObjectpublic double getXLocation()
LocalBoundedObject
getXLocation in interface LocalBoundedObjectpublic double getYLocation()
LocalBoundedObject
getYLocation in interface LocalBoundedObjectpublic double getFacing()
LocalBoundedObject
getFacing in interface LocalBoundedObjectpublic void timePassing(double time)
time - amount of time passing (in millisols)
BuildingException - if error occurs.public double getFullPowerRequired()
public double getPoweredDownPowerRequired()
public String getPowerMode()
public void setPowerMode(String powerMode)
public MalfunctionManager getMalfunctionManager()
getMalfunctionManager in interface Malfunctionablepublic Collection<Person> getAffectedPeople()
getAffectedPeople in interface Malfunctionablepublic Inventory getInventory()
getInventory in interface Malfunctionablepublic String toString()
toString in class Objectpublic int compareTo(Building o)
compareTo in interface Comparable<Building>o - the Object to be compared.
public void destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||