book1Person Class Reference

#include <book1-person.hpp>

Inheritance diagram for book1Person:

Inheritance graph
[legend]
Collaboration diagram for book1Person:

Collaboration graph
[legend]
List of all members.

Detailed Description

Defines a class representing a NPC or PC from book 1 from the original Traveller boxed set.

See also:
personObj

skillList

Todo:
implement draft

Definition at line 43 of file book1-person.hpp.

Public Member Functions

 book1Person ()
void toStdOut ()
void XMLout (FILE *fout)


Constructor & Destructor Documentation

book1Person::book1Person (  ) 

Non paramtized constructor.

Definition at line 53 of file book1-person.cpp.

00053                         :personObj(){
00054                 
00055                 
00056                 
00057 };


Member Function Documentation

void book1Person::toStdOut (  ) 

Dump a string representation of this character to stdout.

Todo:
consider moving this to the base class.

Definition at line 69 of file book1-person.cpp.

References personObj::getAge(), personObj::getCommissioned(), personObj::getRank(), personObj::getService(), personObj::getTerms(), personObj::listOfSkills(), personObj::listOfSkillString(), personObj::skillCount(), and personObj::UPPasString().

00069                           {
00070         char *buffer;
00071         int  skillCount = this->skillCount();
00072         char **listOfSkills = this->listOfSkills();
00073         char cashBuffer[80];
00074         
00075         int  ix;
00076         int iy;
00077         
00078         std::cout << this->UPPasString() << " Age: " << this->getAge() << " " << this->getService();
00079         std::cout << "  " << this->getTerms() << " terms" ; 
00080         if ( this-> getCommissioned() == 1 ) {
00081                 std::cout << "  Rank: " << this->getRank();
00082         }
00083         std::cout << std::endl;
00084         sprintf(cashBuffer,"%7g",this->getCash());
00085         std::cout << "Cash: " << cashBuffer << std::endl;
00086         
00087         std::cout << "Skills:" << "\n\n";
00088         
00089         iy=1;
00090         
00091         std::cout << this->listOfSkillString() << "\n\n";
00092         
00093         
00094                 
00095         for(ix=0;ix<72;ix++) std::cout<< "*";
00096         
00097         std::cout<<std::endl;
00098         
00099         
00100         
00101 }

Here is the call graph for this function:

void book1Person::XMLout ( FILE *  fout  ) 

Write the XML representation of this object to a given file.

Parameters:
fout Handle to the file to write the XML to

Definition at line 125 of file book1-person.cpp.

References personObj::getBenefitList(), personObj::getSkillList(), materialBenefitList::XMLout(), and skillList::XMLout().

00125                                   {
00126         fprintf(fout,"%s\n",createStartElement("person"));
00127         
00128         fprintf(fout,"\t%sbook-1%s\n",createStartElement("type"),createEndElement("type"));
00129         
00130         this->PhysicalStats2XML(fout);
00131         
00132         fprintf(fout,"\t%s%s%s\n",createStartElement("service"),
00133                         this->getService(),
00134                         createEndElement("service"));
00135         if ( this->getCommissioned() == 1 ) {
00136                 fprintf(fout,"\t%s%d%s\n",
00137                                 createStartElement("rank"),
00138                                 this->getRank(),
00139                                 createEndElement("rank")
00140                                 );
00141         }
00142         fprintf(fout,"\t%s%d%s\n",
00143                         createStartElement("terms"),
00144                         this->getTerms(),
00145                         createEndElement("terms")
00146                         );
00147         fprintf(fout,"\t%s%6g%s\n",
00148                         createStartElement("cash"),
00149                         this->getCash(),
00150                         createEndElement("cash")
00151                         );
00152         
00153         this->getSkillList()->XMLout(fout);
00154         this->getBenefitList()->XMLout(fout);
00155         
00156         fprintf(fout,"%s\n",createEndElement("person"));
00157                         
00158         
00159         
00160 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Mar 7 16:41:15 2008 for frpuniverse by  doxygen 1.4.7