|
||||||||||
| 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 String |
ASSOCIATED_SETTLEMENT_EVENT
|
static String |
BURIED
Status string used when Person has been buried |
static String |
FEMALE
|
static String |
INSETTLEMENT
Status string used when Person resides in settlement |
static String |
INVEHICLE
Status string used when Person resides in a vehicle |
static String |
MALE
|
static 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(String name,
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 |
void |
destroy()
Prepare object for garbage collection. |
int |
getAge()
Returns the person's age |
Settlement |
getAssociatedSettlement()
Gets the settlement the person is currently associated with. |
String |
getBirthDate()
Returns the person's birth date |
String |
getGender()
Gets the gender of the person ("male" or "female") |
Collection<Person> |
getLocalGroup()
Gets the person's local group of people (in building or rover) |
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 |
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 |
double |
getXLocation()
Gets the person's X location at a settlement. |
double |
getYLocation()
Gets the person's Y location at a settlement. |
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 |
setXLocation(double xLocation)
Sets the person's X location at a settlement. |
void |
setYLocation(double yLocation)
Sets the person's Y location at a settlement. |
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, hasUnitListener, 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 String ASSOCIATED_SETTLEMENT_EVENT
public static final String INSETTLEMENT
public static final String INVEHICLE
public static final String OUTSIDE
public static final String BURIED
public static final String MALE
public static final String FEMALE
| Constructor Detail |
|---|
public Person(String name,
String gender,
Settlement settlement)
name - the person's namegender - the person's gender ("male" or "female")settlement - the settlement the person is at
Exception - if no inhabitable building available at settlement.| Method Detail |
|---|
public String getLocationSituation()
public double getXLocation()
public void setXLocation(double xLocation)
xLocation - the X distance (meters) from the settlement's center.public double getYLocation()
public void setYLocation(double yLocation)
yLocation - 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)
timePassing in class Unittime - amount of time passing (in millisols).public NaturalAttributeManager getNaturalAttributeManager()
public double getPerformanceRating()
public PhysicalCondition getPhysicalCondition()
public Mind getMind()
public int getAge()
public String getBirthDate()
public void consumeFood(double amount,
boolean takeFromInv)
amount - the amount of food to consume (in kg)takeFromInv - is food taken from local inventory?public String getGender()
public Collection<Person> getLocalGroup()
public boolean isFitForOperatingVehicle()
isFitForOperatingVehicle in interface VehicleOperatorpublic 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.public void destroy()
Unit
destroy in class Unit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||