#include <item.h>
Inheritance diagram for TDefenseType:
Public Methods | |
TDefenseType () | |
TDefenseType (const int2 StandardEfficiency) | |
TDefenseType (const TDefenseType &OldDefenseType) | |
virtual | ~TDefenseType ()=0 |
virtual bool | load (TDataPackageList *in) |
virtual bool | save (TDataPackageList *out) const |
virtual void | setStandardEfficiency (const int2 StandardEfficiency) |
virtual int2 | getStandardEfficiency () const |
virtual void | setDefenseEfficiency (const TItem::tWeaponType WeaponType, const int2 Efficiency) |
virtual int2 | getDefenseEfficiency (const TItem::tWeaponType WeaponType) const |
virtual bool | operator== (const TDefenseType &DefenseType) const |
Protected Types | |
typedef TPEList< TEfficiencyToken >::const_iterator | tEfficienciesIteratorConst |
typedef TPEList< TEfficiencyToken >::iterator | tEfficienciesIterator |
Protected Methods | |
virtual TDefenseType & | operator= (const TDefenseType &DefenseType) |
Protected Attributes | |
int2 | fStandardEfficiency |
TPEList< TEfficiencyToken > | fEfficiencies |
|
This is the type definition for the iterator through the efficiencies array. |
|
This is the type definition for the const iterator through the efficiencies array. |
|
This constructor generates a new TDefenseType object with all properties resetted. This means the value for the standard efficiency is 100 and the defense type doesn't know any weapons types. These you have to make known with setDefenseEfficiency. |
|
This constructor generates a also new TDefenseType 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 setDefenseEfficiency. |
|
This constructor creates also a new defense type, but the attributes are copied from the defense type given in OldDefenseType. Mostly implemented to provide a copy constructor.
|
|
Destructs the object. It has to be called for destruction of the object, because it releases the memory used for the efficiencies list. |
|
With the method getDefenseEfficiency you can get the efficiency value of the defense type against a certain weapon type.
|
|
With the method getStandardEfficiency you can get the standard efficiency value against all unknown weapons.
|
|
The method Load loads a TDefenseType object from the data packages in the list. All sub classes of TDefenseType have to reimplement the Load method and they must call TDefenseType::Load explicitly in their Load method to load the data correctly.
Reimplemented from TLinkable. Reimplemented in TArmorType, and TShieldType. |
|
This is the assignment operator for TDefenseType. |
|
With the method operator== you can compare two TDefenseType objects. This is of course the behaviour one would expect from "operator==". The method teste whether both defense types have the same efficiencies for all possible weapon types at the moment. That means, the number of known weapon types can be different, but the behavior is still equal and this method will decide then for equal.
|
|
The method Save saves a TDefenseType by adding the data packages to the list. All sub classes of TDefenseType have to reimplement the Save method and they must call TDefenseType::Save explicitly in their Save method to save the data correctly.
Reimplemented from TLinkable. Reimplemented in TArmorType, and TShieldType. |
|
With the method setDefenseEfficiency you can set the efficiency value of the defense type against a certain weapon type.
|
|
With the method setStandardEfficiency you can set the standard efficiency value against all unknown weapons.
|
|
the list of efficiencies of the defense type against different weapon types |
|
the standard defense efficiency against all weapons |