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

TEWeapon Class Reference

TEWeapon represents a standard energy weapon for a ship. More...

#include <item.h>

Inheritance diagram for TEWeapon:

Inheritance graph
[legend]
Collaboration diagram for TEWeapon:

Collaboration graph
[legend]
List of all members.

Public Methods

 TEWeapon ()
 TEWeapon (const TEWeapon &OldEWeapon)
virtual ~TEWeapon ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TItem::tItemType getItemType () const
virtual void setEfficientRange (const int4 EfficientRange)
virtual int4 getEfficientRange () const
virtual bool operator== (const TEWeapon &EWeapon) const
virtual TEWeapon & operator= (const TEWeapon &EWeapon)

Protected Attributes

int4 fEfficientRange

Detailed Description

TEWeapon represents a standard 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 TEWeapon is derived from TItem (and that is derived from TItem) and can therefore be put on a ship design. TEWeapon represents a standard energy weapon for a ship. As all other items it has mass, volume and surface area. A standard 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 taht it has a value for efficient range. 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 TEWeapon item class. FIXME, until now, the type of the weapon is an integer. This could change in future.


Constructor & Destructor Documentation

TEWeapon::TEWeapon  
 

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

TEWeapon::TEWeapon const TEWeapon &    OldEWeapon
 

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

Parameters:
OldEWeapon  the TEWeapon object which shall be copied

virtual TEWeapon::~TEWeapon   [virtual]
 

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


Member Function Documentation

virtual int4 TEWeapon::getEfficientRange   const [virtual]
 

With the method getEfficientRange you can get the efficient range in which a shot still causes significant damage.

Returns:
the efficient range of the weapon

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

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

Returns:
TItem::EWEAPON

Reimplemented from TWeapon.

virtual bool TEWeapon::load TDataPackageList   in [virtual]
 

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

This is the assignment operator for TEWeapon.

virtual bool TEWeapon::operator== const TEWeapon &    EWeapon const [virtual]
 

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

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

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

The method Save saves a TEWeapon 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 TEWeapon::setEfficientRange const int4    EfficientRange [virtual]
 

The method setEfficientRange sets the efficient range in which a shot still causes significant damage.

Parameters:
EfficientRange  the new efficient range of the weapon


Member Data Documentation

int4 TEWeapon::fEfficientRange [protected]
 

the efficient range of the standard energy weapon


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