|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.Unit
org.mars_sim.msp.core.person.Person
public class Person
The Person class represents a person on Mars. It keeps track of everything related to that person and provides information about him/her.
| Field Summary | |
|---|---|
static java.lang.String |
ASSOCIATED_SETTLEMENT_EVENT
|
static java.lang.String |
BURIED
Status string used when Person has been buried |
static java.lang.String |
FEMALE
|
static java.lang.String |
INSETTLEMENT
Status string used when Person resides in settlement |
static java.lang.String |
INVEHICLE
Status string used when Person resides in a vehicle |
static java.lang.String |
MALE
|
static java.lang.String |
OUTSIDE
Status string used when Person is outside |
| Fields inherited from class org.mars_sim.msp.core.Unit |
|---|
CONTAINER_UNIT_EVENT, DESCRIPTION_EVENT, LOCATION_EVENT, MASS_EVENT, NAME_EVENT |
| Constructor Summary | |
|---|---|
Person(java.lang.String name,
java.lang.String gender,
Settlement settlement)
Constructs a Person object at a given settlement |
|
| Method Summary | |
|---|---|
void |
addScientificAchievement(double achievementCredit,
Science science)
Add achievement credit to the person in a scientific field. |
void |
buryBody()
Bury the Person at the current location. |
void |
consumeFood(double amount,
boolean takeFromInv)
Person consumes given amount of food |
int |
getAge()
Returns the person's age |
Settlement |
getAssociatedSettlement()
Gets the settlement the person is currently associated with. |
java.lang.String |
getBirthDate()
Returns the person's birth date |
java.lang.String |
getGender()
Gets the gender of the person ("male" or "female") |
java.util.Collection<Person> |
getLocalGroup()
Gets the person's local group of people (in building or rover) |
java.lang.String |
getLocationSituation()
Returns a string for the person's relative location "In Settlement", "In Vehicle", "Outside" or "Buried" |
Mind |
getMind()
Returns the person's mind |
NaturalAttributeManager |
getNaturalAttributeManager()
Returns a reference to the Person's natural attribute manager |
java.lang.String |
getOperatorName()
Gets the name of the vehicle operator |
double |
getPerformanceRating()
Get the performance factor that effect Person with the complaint. |
PhysicalCondition |
getPhysicalCondition()
Returns a reference to the Person's physical condition |
double |
getScientificAchievement(Science science)
Gets the person's achievement credit for a given scientific field. |
Settlement |
getSettlement()
Get settlement person is at, null if person is not at a settlement |
double |
getTotalScientificAchievement()
Gets the person's total scientific achievement credit. |
Vehicle |
getVehicle()
Get vehicle person is in, null if person is not in vehicle |
boolean |
isFitForOperatingVehicle()
Checks if the vehicle operator is fit for operating the vehicle. |
void |
setAssociatedSettlement(Settlement newSettlement)
Sets the associated settlement for a person. |
void |
setContainerUnit(Unit containerUnit)
Sets the unit's container unit. |
void |
timePassing(double time)
Person can take action with time passing |
| Methods inherited from class org.mars_sim.msp.core.Unit |
|---|
addUnitListener, compareTo, fireUnitUpdate, fireUnitUpdate, getBaseMass, getContainerUnit, getCoordinates, getDescription, getInventory, getMass, getName, getTopContainerUnit, getUnitManager, removeUnitListener, setBaseMass, setCoordinates, setDescription, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ASSOCIATED_SETTLEMENT_EVENT
public static final java.lang.String INSETTLEMENT
public static final java.lang.String INVEHICLE
public static final java.lang.String OUTSIDE
public static final java.lang.String BURIED
public static final java.lang.String MALE
public static final java.lang.String FEMALE
| Constructor Detail |
|---|
public Person(java.lang.String name,
java.lang.String gender,
Settlement settlement)
throws java.lang.Exception
name - the person's namegender - the person's gender ("male" or "female")settlement - the settlement the person is at
java.lang.Exception - if no inhabitable building available at settlement.| Method Detail |
|---|
public java.lang.String getLocationSituation()
public Settlement getSettlement()
public Vehicle getVehicle()
public void setContainerUnit(Unit containerUnit)
setContainerUnit in class UnitcontainerUnit - the unit to contain this unit.public void buryBody()
public void timePassing(double time)
throws java.lang.Exception
timePassing in class Unittime - amount of time passing (in millisols) throws Exception if
error during time.
java.lang.Exception - if error during time passing.public NaturalAttributeManager getNaturalAttributeManager()
public double getPerformanceRating()
public PhysicalCondition getPhysicalCondition()
public Mind getMind()
public int getAge()
public java.lang.String getBirthDate()
public void consumeFood(double amount,
boolean takeFromInv)
throws java.lang.Exception
amount - amount of food to consume (in kg)takeFromInv - is food taken from local inventory?
java.lang.Exception - if error consuming food.public java.lang.String getGender()
public java.util.Collection<Person> getLocalGroup()
throws java.lang.Exception
java.lang.Exception - if errorpublic boolean isFitForOperatingVehicle()
isFitForOperatingVehicle in interface VehicleOperatorpublic java.lang.String getOperatorName()
getOperatorName in interface VehicleOperatorpublic Settlement getAssociatedSettlement()
public void setAssociatedSettlement(Settlement newSettlement)
newSettlement - the new associated settlement or null if none.public double getScientificAchievement(Science science)
science - the scientific field.
public double getTotalScientificAchievement()
public void addScientificAchievement(double achievementCredit,
Science science)
achievementCredit - the achievement credit.science - the scientific field.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||