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

TShieldType Class Reference

TShieldType contains shield efficiencies against different weapons. More...

#include <item.h>

Inheritance diagram for TShieldType:

Inheritance graph
[legend]
Collaboration diagram for TShieldType:

Collaboration graph
[legend]
List of all members.

Public Methods

 TShieldType ()
 TShieldType (const int2 StandardEfficiency)
 TShieldType (const TShieldType &OldShieldType)
virtual ~TShieldType ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual void setRegenerationRate (int2 RegenerationRate)
virtual int2 getRegenerationRate () const
virtual bool operator== (const TShieldType &ShieldType) const
virtual TShieldType & operator= (const TShieldType &ShieldType)

Protected Attributes

int2 fRegenerationRate

Detailed Description

TShieldType contains shield efficiencies against different weapons.

Author:
Ralf Laue
Version:
Id:
item.h,v 1.34 2002/04/02 22:33:08 prolator Exp
See also:
TDefenseType , TShield
The class TShieldType provides the type for shields or rather the information about their efficiencies against different weapon types. It is derived from TDefenseType and has therefor an unique ID and can be linked (see also TLinkable). An shield type contains a list/array with types of weapons and the related efficiencies of the shield (or shields) against them. The hit point value for shields is provided by TShield. If a weapon type is not yet known a standard efficiency against all weapons is returned. This value can be changed with setStandardEfficiency and it can be read with getStandardEfficiency. The value of the standard efficiency is initialized with 100 if you use the constructor without parameters or to the value you want, if you use the constructor with StandardEfficiency as parameter. The 100 are chosen in expectation, that the values are percental values. If that's not correct, the implementation should perhaps be changed in fufture.
Besides the values inherited from TDefenseType TShieldType has a field for the regeneration rate of the shield. It is initialized with 0, but can be set with the method setRegenerationRate and can be read out with the method getRegenerationRate.


Constructor & Destructor Documentation

TShieldType::TShieldType  
 

This constructor generates a new TShieldType object with all properties resetted. This means the value for the standard efficiency is 100 and the shield type doesn't know any weapons types. These you have to make known with setDefenseEfficiency.

TShieldType::TShieldType const int2    StandardEfficiency
 

This constructor generates a also new TShieldType object, but only with the defense efficiencies resetted. The standard efficiency is set to the value given as parameter. The efficiencies against weapon types have to be set with setShieldEfficiency.

TShieldType::TShieldType const TShieldType &    OldShieldType
 

This constructor creates also a new defense type, but the attributes are copied from the defense type given in OldShieldType. Mostly implemented to provide a copy constructor.

Parameters:
OldShieldType  the TShieldType object which shall be copied

virtual TShieldType::~TShieldType   [virtual]
 

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


Member Function Documentation

virtual int2 TShieldType::getRegenerationRate   const [virtual]
 

With the method getRegenerationRate you can get the regeneration rate of shields of this shield type.

Returns:
the regeneration rate of the shield type

virtual bool TShieldType::load TDataPackageList   in [virtual]
 

The method Load loads a TShieldType object from the data packages in the list. All sub classes of TShieldType have to reimplement the Load method and they must call TShieldType::Load explicitly in their Load method to load the data correctly.

Parameters:
in  the list of data packages
Returns:
true means that everything was loaded correctly, otherwise this method will return false.
See also:
TLinkable

Reimplemented from TDefenseType.

virtual TShieldType& TShieldType::operator= const TShieldType &    ShieldType [virtual]
 

This is the assignment operator for TShieldType.

virtual bool TShieldType::operator== const TShieldType &    ShieldType const [virtual]
 

With the method operator== you can compare two TShieldType objects. This is of course the behaviour one would expect from "operator==".

Parameters:
ShieldType  the TShieldType object to be compared with *this
Returns:
true if the TShieldType objects are equal, false if not

virtual bool TShieldType::save TDataPackageList   out const [virtual]
 

The method Save saves a TShieldType by adding the data packages to the list. All sub classes of TShieldType have to reimplement the Save method and they must call TShieldType::Save explicitly in their Save method to save the data correctly.

Parameters:
out  the output stream of data packages
Returns:
true means that everything was saved correctly, otherwise this method will return false.
See also:
TLinkable

Reimplemented from TDefenseType.

virtual void TShieldType::setRegenerationRate int2    RegenerationRate [virtual]
 

With the method setRegenerationRate you can set the regeneration rate of shields of this shield type.

Parameters:
RegenerationRate  the new regeneration rate of the shield type


Member Data Documentation

int2 TShieldType::fRegenerationRate [protected]
 

the regeneration rate of this shield type


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