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

TJammer Class Reference

TJammer represents a jammer for ships. More...

#include <item.h>

Inheritance diagram for TJammer:

Inheritance graph
[legend]
Collaboration diagram for TJammer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  tJammerType { NORMAL = 0x0001, DISGUISE = 0x0002, CLOAK = 0x0004, ANTIPENETRATE = 0x0008 }

Public Methods

 TJammer ()
 TJammer (const TJammer &OldJammer)
virtual ~TJammer ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TItem::tItemType getItemType () const
virtual TJammer::tJammerType getJammerType () const=0
virtual void setJamEfficiency (const int2 JamEfficiency)
virtual int2 getJamEfficiency () const
virtual bool operator== (const TJammer &Jammer) const

Protected Methods

virtual TJammer & operator= (const TJammer &Jammer)

Protected Attributes

int2 fJamEfficiency

Detailed Description

TJammer represents a jammer for ships.

Author:
Ralf Laue
Version:
Id:
item.h,v 1.34 2002/04/02 22:33:08 prolator Exp
See also:
TShipDesign
The class TJammer is derived from TItem and it is (like TItem) a pure virtual class. The actual jammers will be derived from this class. But already at this level the value JamEfficiency is implemented because all sub classes need it. Only the method getJammerType() is pure virtual and is implemented in each of the sub classes. The jammer type which is returned is of type tJammerType, an enum in this class. Which effects the value JamEfficiency exactly has is decided by the rule set/battle engine and of no direct concern to TJammer or its sub classes. Because it is a pure virtual class there is also no operator=.


Member Enumeration Documentation

enum TJammer::tJammerType
 

Each from TJammer derived class (i.e. TJammerNormal) will return one of these constants to indentify itself. This is especially important in connection with the battle engine.


Constructor & Destructor Documentation

TJammer::TJammer  
 

This constructor doesn't work, because TJammer is a pure virtual class. It's only implemented to be used by the sub classes of TJammer.

TJammer::TJammer const TJammer &    OldJammer
 

This constructor doesn't work either and is implemented to provide a copy constructor for the sub classes.

Parameters:
OldJammer  the jammer which shall be copied.

virtual TJammer::~TJammer   [virtual]
 

Destructs the object. Has nothing else to do, because no memory has to be freed or similar stuff. Doesn't work, because TJammer is a pure virtual class and you wont be able to construct an object.


Member Function Documentation

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

The method getItemType returns the type of the item, in this case TItem::JAMMER for targeting computer.

Returns:
TItem::JAMMER

Reimplemented from TItem.

virtual int2 TJammer::getJamEfficiency   const [virtual]
 

With the method getJamEfficiency you can get the jammer's efficiency An actual object will be of one of the sub classes, but because they will not change anything at this method, it will not have to be reimplemented in the sub classes.

Returns:
the jammer's efficiency

virtual TJammer::tJammerType TJammer::getJammerType   const [pure virtual]
 

With the method getJammerType you can get the type of the jammer, that means whether it is a normal jammer or something else. This method has to be reimplemented in all the derived classes.

Returns:
nothing

Reimplemented in TJammerNormal, TJammerDisguise, TJammerCloak, and TJammerAntiPenetrate.

virtual bool TJammer::load TDataPackageList   in [virtual]
 

The method Load loads a TJammer object from the data packages in the list. All sub classes of TJammer have to reimplement the Load method and they must call TJammer::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 TItem.

Reimplemented in TJammerNormal, TJammerDisguise, TJammerCloak, and TJammerAntiPenetrate.

virtual TJammer& TJammer::operator= const TJammer &    Jammer [protected, virtual]
 

The assignment operator for TJammer

virtual bool TJammer::operator== const TJammer &    Jammer const [virtual]
 

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

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

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

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

Reimplemented in TJammerNormal, TJammerDisguise, TJammerCloak, and TJammerAntiPenetrate.

virtual void TJammer::setJamEfficiency const int2    JamEfficiency [virtual]
 

The method setJamEfficiency sets the efficiency of the jammer. An actual object will be of one of the sub classes, but because they will not change anything at this method, it will not have to be reimplemented in the sub classes.

Parameters:
JamEfficiency  the jammer's efficiency


Member Data Documentation

int2 TJammer::fJamEfficiency [protected]
 

the jammer's efficiency


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