#include <person-obj.hpp>
Inheritance diagram for personObj:
Definition at line 48 of file person-obj.hpp.
personObj::personObj | ( | ) |
Non paramitized constructor.
Definition at line 33 of file person-obj.cpp.
00033 { 00034 int ix; 00035 for(ix=0;ix<6;ix++){ 00036 physical_stats.upp[ix]=d2d6(); 00037 } 00038 age = 18; 00039 accepted=0; 00040 alive=1; 00041 terms=0; 00042 rank=0; 00043 commissioned=0; 00044 cash=0; 00045 skills = new skillList(); 00046 musterOutBenefits = new materialBenefitList(); 00047 00048 }
void personObj::addMaterialBenefit | ( | materialBenefit * | b | ) |
Add a material muster out benefit
b | pointer to a materialBenefit derived object |
Definition at line 263 of file person-obj.cpp.
References materialBenefitList::addBenefit().
00263 { 00264 musterOutBenefits->addBenefit(b); 00265 }
Here is the call graph for this function:
void personObj::addSkill | ( | int | s, | |
int | l | |||
) |
Add a skill to this character.
s | -- integer index into the skill desired. | |
l | -- integer value for level of skill to add. |
Definition at line 237 of file person-obj.cpp.
References skillList::addSkill().
Referenced by b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the call graph for this function:
Here is the caller graph for this function:
int personObj::getAccepted | ( | ) |
Get the state of the accepted flag.
Definition at line 199 of file person-obj.cpp.
int personObj::getAge | ( | ) |
Get the age attribute
Definition at line 184 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
Here is the caller graph for this function:
int personObj::getAlive | ( | ) |
Get the state of this character. 1 if alive, 0 if dead.
Definition at line 221 of file person-obj.cpp.
materialBenefitList * personObj::getBenefitList | ( | ) |
Get the material benefits list
Definition at line 259 of file person-obj.cpp.
Referenced by book1Person::XMLout().
Here is the caller graph for this function:
double personObj::getCash | ( | ) |
Get the amount of cash the character has.
Definition at line 251 of file person-obj.cpp.
int personObj::getCommissioned | ( | ) |
Get the state of if this character has earned an officer's commission.
Definition at line 49 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
Here is the caller graph for this function:
int personObj::getDexterity | ( | ) |
get the dexterity attribute
Definition at line 148 of file person-obj.cpp.
int personObj::getEducation | ( | ) |
Get the education attribute
Definition at line 168 of file person-obj.cpp.
Referenced by b1NavyPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
int personObj::getEndurance | ( | ) |
get the endurance attribute
Definition at line 156 of file person-obj.cpp.
Referenced by b1ArmyPerson::enlist().
Here is the caller graph for this function:
int personObj::getIndexedAttribute | ( | int | ix | ) |
Get an indexed attribute
ix | index into the parameter array |
Definition at line 70 of file person-obj.cpp.
int personObj::getIntelligence | ( | ) |
get the intelligence attribute
Definition at line 160 of file person-obj.cpp.
Referenced by b1MerchantPerson::enlist().
Here is the caller graph for this function:
int personObj::getRank | ( | ) |
Get the rank of an officer character.
Definition at line 56 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
Here is the caller graph for this function:
char * personObj::getService | ( | ) |
Return the value of the service the character served in.
Definition at line 104 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
Here is the caller graph for this function:
skillList * personObj::getSkillList | ( | ) |
Get the skill list...
Definition at line 247 of file person-obj.cpp.
Referenced by book1Person::XMLout().
Here is the caller graph for this function:
int personObj::getSocialStanding | ( | ) |
get the social_standing attribute
Definition at line 180 of file person-obj.cpp.
Referenced by b1NavyPerson::enlist(), and b1MarinePerson::enlist().
Here is the caller graph for this function:
int personObj::getStrength | ( | ) |
get the strength attribute
Definition at line 136 of file person-obj.cpp.
int personObj::getTerms | ( | ) |
return the number of terms the character has served.
Definition at line 62 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
Here is the caller graph for this function:
void personObj::incrementAge | ( | int | ix | ) |
Increment Age
ix | integer amount to increment by |
Definition at line 108 of file person-obj.cpp.
void personObj::incrementAttribute | ( | int | attr, | |
int | incr | |||
) |
Increment an attribute
attr | integer index to the attribute to increment | |
incr | integer amount to incrmenet by. |
Definition at line 192 of file person-obj.cpp.
Referenced by incrementDexterity(), incrementEducation(), incrementEndurance(), incrementIntelligence(), incrementSocialStanding(), and incrementStrength().
00192 { 00193 physical_stats.upp[attr] = physical_stats.upp[attr] + incr; 00194 if ( physical_stats.upp[attr] < 0 ) 00195 physical_stats.upp[attr] = 0; 00196 00197 }
Here is the caller graph for this function:
void personObj::incrementDexterity | ( | int | ix | ) |
Increment Dexterity
ix | integer amount to increment by |
Definition at line 116 of file person-obj.cpp.
References incrementAttribute().
00116 { 00117 this->incrementAttribute(DEXTERITY,ix); 00118 }
Here is the call graph for this function:
void personObj::incrementEducation | ( | int | ix | ) |
Increment Education
ix | integer amount to increment by |
Definition at line 128 of file person-obj.cpp.
References incrementAttribute().
00128 { 00129 this->incrementAttribute(EDUCATION,ix); 00130 }
Here is the call graph for this function:
void personObj::incrementEndurance | ( | int | ix | ) |
Increment endurance
ix | integer amount to increment by |
Definition at line 120 of file person-obj.cpp.
References incrementAttribute().
00120 { 00121 this->incrementAttribute(ENDURANCE,ix); 00122 }
Here is the call graph for this function:
void personObj::incrementIntelligence | ( | int | ix | ) |
Increment Intelligence
ix | integer amount to increment by |
Definition at line 124 of file person-obj.cpp.
References incrementAttribute().
00124 { 00125 this->incrementAttribute(INTELLIGENCE,ix); 00126 }
Here is the call graph for this function:
void personObj::incrementSocialStanding | ( | int | ix | ) |
Increment Social Standing
ix | integer amount to increment by |
Definition at line 132 of file person-obj.cpp.
References incrementAttribute().
Referenced by b1NavyPerson::enlist().
00132 { 00133 this->incrementAttribute(SOCIALSTANDING,ix); 00134 }
Here is the call graph for this function:
Here is the caller graph for this function:
void personObj::incrementStrength | ( | int | ix | ) |
Increment Strength
ix | integer amount to increment by |
Definition at line 112 of file person-obj.cpp.
References incrementAttribute().
00112 { 00113 this->incrementAttribute(STRENGTH,ix); 00114 }
Here is the call graph for this function:
char ** personObj::listOfSkills | ( | ) |
A list of the character's skills
Definition at line 232 of file person-obj.cpp.
References skillList::listOfSkills().
Referenced by book1Person::toStdOut().
00232 { 00233 return skills->listOfSkills(); 00234 }
Here is the call graph for this function:
Here is the caller graph for this function:
char * personObj::listOfSkillString | ( | ) |
Get the list of skills as a single pointer to character string.
Definition at line 243 of file person-obj.cpp.
References skillList::listOfSkillString().
Referenced by book1Person::toStdOut().
00243 { 00244 return skills->listOfSkillString(); 00245 }
Here is the call graph for this function:
Here is the caller graph for this function:
void personObj::setAccepted | ( | int | i | ) |
Set the flag that the character was accepted.
i | integer value (should be 1 or 0) |
Definition at line 202 of file person-obj.cpp.
Referenced by b1ScoutPerson::enlist(), b1OtherPerson::enlist(), b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
void personObj::setAge | ( | int | a | ) |
Set the age attribute
a | integer value for age |
Definition at line 188 of file person-obj.cpp.
Referenced by b1ScoutPerson::enlist(), b1OtherPerson::enlist(), b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
void personObj::setAlive | ( | int | a | ) |
Set the state of if this character is alive or dead.
a | -- integer value if 1 character is alive 0 if dead. |
Definition at line 224 of file person-obj.cpp.
Referenced by b1ScoutPerson::enlist(), b1OtherPerson::enlist(), b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
void personObj::setCash | ( | double | c | ) |
Set the cash for this character
c | (double) value for amount to set cash to. |
Definition at line 255 of file person-obj.cpp.
void personObj::setCommissioned | ( | int | c | ) |
Set the state if the character has earned an officer's commission.
c | -- integer value 1 if character is an officer 0 if not. |
Definition at line 53 of file person-obj.cpp.
Referenced by b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
void personObj::setDexterity | ( | int | d | ) |
set the dexterity attribute
d | integer value of dexterity |
Definition at line 144 of file person-obj.cpp.
void personObj::setEducation | ( | int | e | ) |
Set the education attribute
e | integer value for education |
Definition at line 172 of file person-obj.cpp.
void personObj::setEndurance | ( | int | c | ) |
set the endurance attribute
c | integer value for endurance |
Definition at line 152 of file person-obj.cpp.
void personObj::setIntelligence | ( | int | i | ) |
set the intelligence attribute
i | integer value for intelligence |
Definition at line 164 of file person-obj.cpp.
void personObj::setRank | ( | int | r | ) |
Set the rank of a character if they are a commissioned officer.
r | integer value of the rank |
Definition at line 59 of file person-obj.cpp.
Referenced by b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
void personObj::setService | ( | char * | s | ) |
Set the string value of the service the character is serving in.
s | pointer to character string representing the service. |
Definition at line 101 of file person-obj.cpp.
Referenced by b1ArmyPerson::b1ArmyPerson(), b1MarinePerson::b1MarinePerson(), b1MerchantPerson::b1MerchantPerson(), b1OtherPerson::b1OtherPerson(), b1ScoutPerson::b1ScoutPerson(), book4ArmyPerson::book4ArmyPerson(), book4Marine::book4Marine(), book5NavyPerson::book5NavyPerson(), book6ScoutPerson::book6ScoutPerson(), book7MerchantPerson::book7MerchantPerson(), b1NavyPerson::enlist(), s4BarbarianPerson::s4BarbarianPerson(), s4BelterPerson::s4BelterPerson(), s4BureaucratPerson::s4BureaucratPerson(), s4DoctorPerson::s4DoctorPerson(), s4FlyerPerson::s4FlyerPerson(), s4HunterPerson::s4HunterPerson(), s4NoblePerson::s4NoblePerson(), s4PiratePerson::s4PiratePerson(), s4RoguePerson::s4RoguePerson(), s4SailorPerson::s4SailorPerson(), and s4ScientistPerson::s4ScientistPerson().
Here is the caller graph for this function:
void personObj::setSocialStanding | ( | int | s | ) |
set the social_standing attribute
s | integer value for social_standing |
Definition at line 176 of file person-obj.cpp.
void personObj::setStrength | ( | int | s | ) |
Set the strength attribute
s | integer value of strength |
Definition at line 140 of file person-obj.cpp.
void personObj::setTerms | ( | int | t | ) |
Set the number of terms the character has served.
t | integer value representing the number of terms the character has served. |
Definition at line 66 of file person-obj.cpp.
Referenced by b1ScoutPerson::enlist(), b1OtherPerson::enlist(), b1NavyPerson::enlist(), b1MerchantPerson::enlist(), b1MarinePerson::enlist(), and b1ArmyPerson::enlist().
Here is the caller graph for this function:
int personObj::skillCount | ( | ) |
how many skills does this character possess?
Definition at line 228 of file person-obj.cpp.
References skillList::skillCount().
Referenced by book1Person::toStdOut().
00228 { 00229 return skills->skillCount(); 00230 }
Here is the call graph for this function:
Here is the caller graph for this function:
int personObj::survived | ( | ) |
Character made survival rolls.
Definition at line 206 of file person-obj.cpp.
00206 { 00207 // I could have just returned the value of "alive" but decided 00208 // this was more readable. So shoot me.... 00209 // 00210 00211 if ( alive == 1 ) return 1; 00212 else return 0; 00213 }
char * personObj::toString | ( | ) |
Dump the person as a string.
Definition at line 74 of file person-obj.cpp.
00074 { 00075 char *buffer; 00076 int ix; 00077 buffer=(char*)malloc(50); // more than what we need, but oh-well... 00078 buffer[0]='\0'; 00079 00080 sprintf(buffer,"%s: ","UPP"); 00081 for(ix=0;ix<6;ix++){ 00082 strcat(buffer,itohex(physical_stats.upp[ix])); 00083 } 00084 sprintf(buffer,"%s Age: %d",buffer,age); 00085 return buffer; 00086 }
char * personObj::UPPasString | ( | ) |
Dump just the UPP as a string.
Definition at line 88 of file person-obj.cpp.
Referenced by book1Person::toStdOut().
00088 { 00089 char *buffer; 00090 int ix; 00091 buffer=(char*)malloc(50); // more than what we need, but oh-well... 00092 buffer[0]='\0'; 00093 00094 sprintf(buffer,"%s: ","UPP"); 00095 for(ix=0;ix<6;ix++){ 00096 strcat(buffer,itohex(physical_stats.upp[ix])); 00097 } 00098 return buffer; 00099 }
Here is the caller graph for this function:
int personObj::wasRejected | ( | ) |
Boolean state if the character was rejected for service.
Definition at line 215 of file person-obj.cpp.