materialBenefit Class Reference

#include <material-benefit.hpp>

Inheritance diagram for materialBenefit:

Inheritance graph
Collaboration diagram for materialBenefit:

Collaboration graph
List of all members.

Detailed Description

A material benefit is something that is awarded to a character upon mustering out of whatever service they have just completed that isn't currency. This class is a base class for those benefits and each benefit type derives from this class and overloads as need be.

See also:


add XML and flat text conversion methods.

Definition at line 65 of file material-benefit.hpp.

Public Member Functions

 materialBenefit (char *s)
void merge (materialBenefit *p)
int getQuantity ()
void setQuantity (int q)
char * getSignature ()
virtual void XMLout (FILE *fout)

Constructor & Destructor Documentation

materialBenefit::materialBenefit ( char *  s  ) 

Within the class constructor we set the signature of this object which gets overloaded by derived objects.

See also:

Definition at line 27 of file material-benefit.cpp.

00027                                         : slinkNode() {
00028         signature=s;
00029 }

Member Function Documentation

int materialBenefit::getQuantity (  ) 

Return the quantity member's value

integer value; quantity

Definition at line 35 of file material-benefit.cpp.

Referenced by merge().

00035                                 {
00036         return quantity;
00037 }

Here is the caller graph for this function:

char * materialBenefit::getSignature (  ) 

Get the object's signature, which is normally set by a derived object

pointer to an array of type char

Definition at line 43 of file material-benefit.cpp.

Referenced by materialBenefitList::addBenefit().

00043                                    {
00044         return signature;
00045 }

Here is the caller graph for this function:

void materialBenefit::merge ( materialBenefit p  ) 

When another benefit of the same type is added to the list of benefits we are goingto merge them by adding the two quantity's together.

p pointer to another mbBlade object

Definition at line 39 of file material-benefit.cpp.

References getQuantity().

Referenced by materialBenefitList::addBenefit().

00039                                              {
00040         quantity = quantity + p->getQuantity();
00041 }

Here is the call graph for this function:

Here is the caller graph for this function:

void materialBenefit::setQuantity ( int  q  ) 

Set the quantity member. (Shouldn't ever be invoked.. but...)

q integer value to set the quantity member to.

Definition at line 31 of file material-benefit.cpp.

Referenced by mbBlade::mbBlade(), mbGun::mbGun(), mbHighPassage::mbHighPassage(), and mbLowPassage::mbLowPassage().

00031                                       {
00032         quantity=q;
00033 }

Here is the caller graph for this function:

void materialBenefit::XMLout ( FILE *  fout  )  [virtual]

Send well formed (I hope!) XML to a file.

fout pointer to a file buffer/handle to write XML to.

Reimplemented in mbBlade, mbGun, mbHighPassage, mbLowPassage, mbPassageObj, mbShip, mbTAS, mbb2FreeTrader, and mbb2Scout.

Definition at line 47 of file material-benefit.cpp.

Referenced by materialBenefitList::XMLout().

00047                                       {
00048         // Do nothing.. this is a base class and this should get overridden by the 
00049         // derived classes, but it needs to be here as a placeholder. 
00050 #ifdef DEBUG_ON
00051         FILE* diaglog = fopen("diaglog.log","a+");
00052         fprintf(diaglog,"Entering and exiting materialBenefit::XMLout\n");
00053         fclose (diaglog);
00054 #endif
00056 }

Here is the caller graph for this function:

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