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

TArmor Class Reference

TArmor represents a armor for a ship. More...

#include <item.h>

Inheritance diagram for TArmor:

Inheritance graph
[legend]
Collaboration diagram for TArmor:

Collaboration graph
[legend]
List of all members.

Public Methods

 TArmor ()
 TArmor (const TArmor &OldArmor)
virtual ~TArmor ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TItem::tItemType getItemType () const
virtual void setHitPoints (const int2 HitPoints)
virtual int2 getHitPoints () const
virtual void setArmorType (TArmorType *ArmorType)
virtual const TArmorTypegetArmorType () const
virtual int2 getArmorEfficiency (const TItem::tWeaponType WeaponType) const
virtual bool operator== (const TArmor &Armor) const
virtual TArmor & operator= (const TArmor &Armor)

Protected Attributes

int2 fHitPoints
TLink< TArmorTypefArmorType

Detailed Description

TArmor represents a armor for a ship.

Author:
Ralf Laue
Version:
Id:
item.h,v 1.34 2002/04/02 22:33:08 prolator Exp
See also:
TShipDesign
The class TArmor is derived from TItem and can therefore be put on a ship design. TArmor represents an armor for a ship design. As all other items it has tech level mass, volume and surface area. Besides that the armor has a number of hit points for the damage it can take and a type (as link to an object of type TDefenseType). You can set and get these value with the respective set???? and get???? methods. Furthermore you can get (only get) the efficiencies of this armor against different weapon types with the method getArmorEfficiency. How the different efficiencies are interpreted exactly is up to the rule set/battle engine and of no direct concern of TArmor.


Constructor & Destructor Documentation

TArmor::TArmor  
 

This constructor generates a new TArmor object with all properties resetted. This means you have to set all properties like name and mass afterwards with help of the respective set<something> methods.

TArmor::TArmor const TArmor &    OldArmor
 

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

Parameters:
OldArmor  the TArmor object which shall be copied

virtual TArmor::~TArmor   [virtual]
 

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


Member Function Documentation

virtual int2 TArmor::getArmorEfficiency const TItem::tWeaponType    WeaponType const [virtual]
 

With the method getArmorEfficiency you can get the efficiency value of the armor against a certain weapon type.

Parameters:
WeaponType  the weapon type you want the efficieny against
Returns:
the efficiency against this weapon type

virtual const TArmorType* TArmor::getArmorType   const [virtual]
 

With the method getArmotType you can get the type of the armor. The type is returned as object of type TDefenseType.

Parameters:
the  type of the armor

virtual int2 TArmor::getHitPoints   const [virtual]
 

With the method getHitPoints you can get the amount of hit points the armor has.

Returns:
the hit points the armor has

virtual TItem::tItemType TArmor::getItemType   const [virtual]
 

The method getItemType returns the type of the item, in this case TItem::ARMOR for armor.

Returns:
TItem::ARMOR

Reimplemented from TItem.

virtual bool TArmor::load TDataPackageList   in [virtual]
 

The method Load loads a TArmor object from the data packages in the list.

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 TItem.

virtual TArmor& TArmor::operator= const TArmor &    Armor [virtual]
 

This is the assignment operator for TArmor.

virtual bool TArmor::operator== const TArmor &    Armor const [virtual]
 

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

Parameters:
Armor  the TArmor object which shall be compared with "*this"
Returns:
true if the TArmor objects are equal, false if not

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

The method Save saves a TArmor object by adding the data packages to the list.

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 TItem.

virtual void TArmor::setArmorType TArmorType   ArmorType [virtual]
 

With the method setArmorType you can set the type of the armor. The type is expected as object of type TDefenseType.

Parameters:
ArmorType  the new type of the armor

virtual void TArmor::setHitPoints const int2    HitPoints [virtual]
 

The method setHitPoints sets the amount of hit points the armor has.

Parameters:
HitPoints  the new amount of hit points for the armor


Member Data Documentation

TLink<TArmorType> TArmor::fArmorType [protected]
 

the type of the armor (see TDefenseType)

int2 TArmor::fHitPoints [protected]
 

the hit points the armor has


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