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

TArmorType Class Reference

TArmorType contains armor efficiencies against different weapons. More...

#include <item.h>

Inheritance diagram for TArmorType:

Inheritance graph
[legend]
Collaboration diagram for TArmorType:

Collaboration graph
[legend]
List of all members.

Public Methods

 TArmorType ()
 TArmorType (const int2 StandardEfficiency)
 TArmorType (const TArmorType &OldArmorType)
virtual ~TArmorType ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual bool operator== (const TArmorType &ArmorType) const
virtual TArmorType & operator= (const TArmorType &ArmorType)

Detailed Description

TArmorType contains armor efficiencies against different weapons.

Author:
Ralf Laue
Version:
Id:
item.h,v 1.34 2002/04/02 22:33:08 prolator Exp
See also:
TArmorType , TArmor
The class TArmorType provides the type for armor 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 armor type contains a list/array with types of weapons and the related efficiencies of the armor (or shields) against them. The hit point value for armors is provided by TArmor. 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.


Constructor & Destructor Documentation

TArmorType::TArmorType  
 

This constructor generates a new TArmorType 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.

TArmorType::TArmorType const int2    StandardEfficiency
 

This constructor generates a also new TArmorType 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 setArmorEfficiency.

TArmorType::TArmorType const TArmorType &    OldArmorType
 

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

Parameters:
OldArmorType  the TArmorType object which shall be copied

virtual TArmorType::~TArmorType   [virtual]
 

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


Member Function Documentation

virtual bool TArmorType::load TDataPackageList   in [virtual]
 

The method Load loads a TArmorType object from the data packages in the list. All sub classes of TArmorType have to reimplement the Load method and they must call TArmorType::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 TArmorType& TArmorType::operator= const TArmorType &    ArmorType [virtual]
 

This is the assignment operator for TArmorType.

virtual bool TArmorType::operator== const TArmorType &    ArmorType const [virtual]
 

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

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

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

The method Save saves a TArmorType by adding the data packages to the list. All sub classes of TArmorType have to reimplement the Save method and they must call TArmorType::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.


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