Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

TEfficiencyToken Class Reference

TEfficiencyToken contains the efficiency againts one weapon type. More...

#include <item.h>

List of all members.

Public Methods

 TEfficiencyToken ()
 TEfficiencyToken (TEfficiencyToken &OldToken)
 ~TEfficiencyToken ()
void setWeaponType (TItem::tWeaponType WeaponType)
TItem::tWeaponType getWeaponType () const
void setEfficiency (int2 Efficiency)
int2 getEfficiency () const
bool operator== (const TEfficiencyToken &Token) const
TEfficiencyToken & operator= (const TEfficiencyToken &Token)
bool load (TDataPackageList *in, const string &sIdentifier, bool bUnique=true)
bool save (TDataPackageList *out, const string &sIdentifier, bool bUnique=true) const

Protected Attributes

TItem::tWeaponType fWeaponType
int2 fEfficiency


Detailed Description

TEfficiencyToken contains the efficiency againts one weapon type.

Author:
Ralf Laue
Version:
Id:
item.h,v 1.34 2002/04/02 22:33:08 prolator Exp
See also:
TDefenseType
The class TEfficiencyToken contains the efficiency of a TDefenseType object against one certain weapon type. Every defense type (that includes armor and shield type) has a list with elements of this class. It has only fields for one weapon type and the efficiency against it. Furthermore it provides operator=, operator== and Load and Save.


Constructor & Destructor Documentation

TEfficiencyToken::TEfficiencyToken  
 

This constructor generates a new TEfficiencyToken object with all properties resetted. That means the value for the efficiency and the weapon type is set to 0. You have to assign meaningful values with the appropriate set???? and get???? methods.

TEfficiencyToken::TEfficiencyToken TEfficiencyToken &    OldToken
 

This constructor also generates a new TEfficiencyToken object, but it copies from the parameter OldToken. This is the copy constructor.

TEfficiencyToken::~TEfficiencyToken  
 

Destructs the object. Has nothing else to do, because no memory has to be freed or similar stuff.


Member Function Documentation

int2 TEfficiencyToken::getEfficiency   const
 

With the method getEfficiency you can get the efficiency against the weapon type.

Returns:
the efficiency against the weapon type

TItem::tWeaponType TEfficiencyToken::getWeaponType   const
 

With the method getWeaponType you can get the weapon type this object contains the efficiency against.

Returns:
the weapon type this object contains the efficiency against

bool TEfficiencyToken::load TDataPackageList   in,
const string &    sIdentifier,
bool    bUnique = true
 

With the method Load you can load a TEfficiencyToken object from the data packages in the list. For more information look in the documentation of TLinkable.

Parameters:
in  the list of data packages
sIdentifier  the string this token is saved under
bUnique  bool value whether the indentifiers have to be unique
Returns:
true means that everything was loaded correctly, otherwise this method will return false.
See also:
TLinkable

TEfficiencyToken& TEfficiencyToken::operator= const TEfficiencyToken &    Token
 

This is the assignment operator for TEfficiencyToken.

bool TEfficiencyToken::operator== const TEfficiencyToken &    Token const
 

With the method operator== you can compare two TEfficiencyToken objects. This is of course the expected behaviour of "operator==".

Parameters:
Token  the TEfficiencyToken object which to be compared with *this
Returns:
true if the TItemPack objects are equal, false if not

bool TEfficiencyToken::save TDataPackageList   out,
const string &    sIdentifier,
bool    bUnique = true
const
 

With the method Save you can save a TEfficiencyToken object from the data packages in the list. For more information look in the documentation of TLinkable.

Parameters:
in  the list of data packages
sIdentifier  the string this token is to be saved under
bUnique  bool value whether the indentifiers have to be unique
Returns:
true means that everything was saved correctly, otherwise this method will return false.
See also:
TLinkable

void TEfficiencyToken::setEfficiency int2    Efficiency
 

With the method setEfficiency you can set the efficiency against the weapon type.

Parameters:
Efficiency  the new efficiency against the weapon type

void TEfficiencyToken::setWeaponType TItem::tWeaponType    WeaponType
 

With the method setWeaponType you can set the weapon type this object should contain the efficiency against.

Parameters:
WeaponType  the new weapon type this object should contain the efficiency against


Member Data Documentation

int2 TEfficiencyToken::fEfficiency [protected]
 

the efficiency against the weapon type

TItem::tWeaponType TEfficiencyToken::fWeaponType [protected]
 

the weapon type


The documentation for this class was generated from the following file:
Generated on Thu Jun 20 18:13:20 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001