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

TKWeapon Class Reference

TKWeapon represents a kinetic energy weapon for a ship. More...

#include <item.h>

Inheritance diagram for TKWeapon:

Inheritance graph
[legend]
Collaboration diagram for TKWeapon:

Collaboration graph
[legend]
List of all members.

Public Methods

 TKWeapon ()
 TKWeapon (const TKWeapon &OldKWeapon)
virtual ~TKWeapon ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TItem::tItemType getItemType () const
virtual void setVelocity (const int4 Velocity)
virtual int4 getVelocity () const
virtual void setAmmunitionSize (const int2 AmmunitionSize)
virtual int2 getAmmunitionSize () const
virtual bool operator== (const TKWeapon &KWeapon) const
virtual TKWeapon & operator= (const TKWeapon &KWeapon)

Protected Attributes

int4 fVelocity
int2 fAmmunitionSize

Detailed Description

TKWeapon represents a kinetic energy weapon 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 TKWeapon is derived from TWeapon (and that is derived from TItem) and can therefore be put on a ship design. TKWeapon represents a kinetic energy weapon for a ship. As all other items it has mass, volume and surface area. A kinetic energy weapon has additionally all value inherited from TWeapon like values for damage points (dp) of caused damage, rate of fire and weapon type. Besides that it has values for velocity of the projectile and the size of the ammunition. The meaning of this values and which different types exist and what they do is up to the rule set/battle engine and of no direct concern to the TKWeapon item class. FIXME, until now, the type of the weapon is an integer. This could change in future.


Constructor & Destructor Documentation

TKWeapon::TKWeapon  
 

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

TKWeapon::TKWeapon const TKWeapon &    OldKWeapon
 

This constructor creates also a new kinetic energy weapon, but the attributes are copied from the kinetic energy weapon given in OldKWeapon. Mostly implemented to provide a copy constructor.

Parameters:
OldKWeapon  the TKWeapon object which shall be copied

virtual TKWeapon::~TKWeapon   [virtual]
 

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


Member Function Documentation

virtual int2 TKWeapon::getAmmunitionSize   const [virtual]
 

With the method getAmmunitionSize you can get the ammunition size of this kinetic weapon. This is important, if you want to know, how much ammunition you can store in a given cargo space.

Returns:
the ammunition size of the kinetic weapon

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

The method getItemType returns the type of the item, in this case TItem::KWEAPON for kinetic weapon.

Returns:
TItem::KWEAPON

Reimplemented from TWeapon.

virtual int4 TKWeapon::getVelocity   const [virtual]
 

With the method getVelocity you can get the velocity of the projectile of the kinetic weapon.

Returns:
the velocity of the projectile of the weapon

virtual bool TKWeapon::load TDataPackageList   in [virtual]
 

The method Load loads a TKWeapon 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 TWeapon.

virtual TKWeapon& TKWeapon::operator= const TKWeapon &    KWeapon [virtual]
 

This is the assignment operator for TKWeapon.

virtual bool TKWeapon::operator== const TKWeapon &    KWeapon const [virtual]
 

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

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

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

The method Save saves a TKWeapon 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 TWeapon.

virtual void TKWeapon::setAmmunitionSize const int2    AmmunitionSize [virtual]
 

The method setAmmunitionSize sets the size of the ammunition of this kinetic weapon. This is important, if you want to know, how much ammunition you can store in a given cargo space.

Parameters:
AmmunitionSize  the new ammunition size of the weapon

virtual void TKWeapon::setVelocity const int4    Velocity [virtual]
 

The method setVelocity sets the velocity of the projectile of the kinetic weapon.

Parameters:
Velocity  the new velocity of the projectile of the weapon


Member Data Documentation

int2 TKWeapon::fAmmunitionSize [protected]
 

the ammunition size of the kinetic weapon

int4 TKWeapon::fVelocity [protected]
 

the velocity of the projectile of the kinetic weapon


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