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

TShield Class Reference

TShield represents a shield for a ship. More...

#include <item.h>

Inheritance diagram for TShield:

Inheritance graph
[legend]
Collaboration diagram for TShield:

Collaboration graph
[legend]
List of all members.

Public Methods

 TShield ()
 TShield (const TShield &OldShield)
virtual ~TShield ()
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 setShieldType (TShieldType *ShieldType)
virtual const TShieldTypegetShieldType () const
virtual int2 getShieldEfficiency (const TItem::tWeaponType WeaponType) const
virtual bool operator== (const TShield &Shield) const
virtual TShield & operator= (const TShield &Shield)

Protected Attributes

int2 fHitPoints
TLink< TShieldTypefShieldType

Detailed Description

TShield represents a shield 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 TShield is derived from TItem and can therefore be put on a ship design. TShield represents a shield 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 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 shield against different weapon types with the method getShieldEfficiency. How the different efficiencies are interpreted exactly is up to the rule set/battle engine and of no direct concern of TShield.


Constructor & Destructor Documentation

TShield::TShield  
 

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

TShield::TShield const TShield &    OldShield
 

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

Parameters:
OldShield  the TShield object which shall be copied

virtual TShield::~TShield   [virtual]
 

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


Member Function Documentation

virtual int2 TShield::getHitPoints   const [virtual]
 

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

Returns:
the amount of hit points the shield has

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

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

Returns:
TItem::SHIELD

Reimplemented from TItem.

virtual int2 TShield::getShieldEfficiency const TItem::tWeaponType    WeaponType const [virtual]
 

With the method getShieldEfficiency you can get the efficiency value of the shield against a certain weapon type.

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

virtual const TShieldType* TShield::getShieldType   const [virtual]
 

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

Parameters:
the  type of the shield

virtual bool TShield::load TDataPackageList   in [virtual]
 

The method Load loads a TShield 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 TShield& TShield::operator= const TShield &    Shield [virtual]
 

This is the assignment operator for TShield.

virtual bool TShield::operator== const TShield &    Shield const [virtual]
 

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

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

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

The method Save saves a TShield 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 TShield::setHitPoints const int2    HitPoints [virtual]
 

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

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

virtual void TShield::setShieldType TShieldType   ShieldType [virtual]
 

With the method setShieldType you can set the type of the shield. The type is expected as object of type TDefenseType.

Parameters:
ShieldType  the new type of the shield


Member Data Documentation

int2 TShield::fHitPoints [protected]
 

the amount of hit points the shield has

TLink<TShieldType> TShield::fShieldType [protected]
 

the type of the shield (see TDefenseType)


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