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

TScanner Class Reference

TScanner represents a scanner for ships. More...

#include <item.h>

Inheritance diagram for TScanner:

Inheritance graph
[legend]
Collaboration diagram for TScanner:

Collaboration graph
[legend]
List of all members.

Public Types

enum  tScannerType {
  NORMAL_ACTIVE = 0x0001, NORMAL_PASSIVE = 0x0002, ANTIDISGUISE_ACTIVE = 0x0004, ANTIDISGUISE_PASSIVE = 0x0008,
  ANTICLOAK_ACTIVE = 0x0010, ANTICLOAK_PASSIVE = 0x0020, PENETRATE_ACTIVE = 0x0040, PENETRATE_PASSIVE = 0x0080
}

Public Methods

 TScanner ()
 TScanner (const TScanner &OldScanner)
virtual ~TScanner ()
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TItem::tItemType getItemType () const
virtual TScanner::tScannerType getScannerType () const=0
virtual void setScanEfficiency (const int2 ScanEfficiency)
virtual int2 getScanEfficiency () const
virtual void setShortRange (int4 Range)
virtual int4 getShortRange ()
virtual void setLongRange (int2 Range)
virtual int2 getLongRange ()
virtual bool operator== (const TScanner &Scanner) const

Protected Methods

virtual TScanner & operator= (const TScanner &Scanner)

Protected Attributes

int2 fScanEfficiency
int4 fShortRange
int2 fLongRange

Detailed Description

TScanner represents a scanner 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 TScanner is derived from TItem and it is (like TItem) a pure virtual class. The actual scanners will be derived from this class. But already at this level the value ScanEfficiency is implemented because all sub classes need it. Only the method getScannerType() is pure virtual and is implemented in each of the sub classes. The scanner type which is returned is of type tScannerType, an enum in this class. Which effects the value ScanEfficiency exactly has is decided by the rule set/battle engine and of no direct concern to TScanner or its sub classes. Because it is a pure virtual class there is also no operator=.


Member Enumeration Documentation

enum TScanner::tScannerType
 

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


Constructor & Destructor Documentation

TScanner::TScanner  
 

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

TScanner::TScanner const TScanner &    OldScanner
 

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

Parameters:
OldScanner  the scanner which shall be copied.

virtual TScanner::~TScanner   [virtual]
 

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


Member Function Documentation

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

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

Returns:
TItem::SCANNER

Reimplemented from TItem.

virtual int2 TScanner::getLongRange   [virtual]
 

With the method getLongRange you can get the range of the long range scan ability of the scanner. This is the range the scanner has on the astar map.

Parameters:
the  range of the long range scan abilities

virtual int2 TScanner::getScanEfficiency   const [virtual]
 

With the method getScanEfficiency you can get the scanner'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 scanner's efficiency

virtual TScanner::tScannerType TScanner::getScannerType   const [pure virtual]
 

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

Returns:
nothing

Reimplemented in TScannerNormalActive, TScannerNormalPassive, TScannerAntiDisguiseActive, TScannerAntiDisguisePassive, TScannerAntiCloakActive, TScannerAntiCloakPassive, TScannerPenetrateActive, and TScannerPenetratePassive.

virtual int4 TScanner::getShortRange   [virtual]
 

With the method getShortRange you can get the range of the short range scan ability of the scanner. This is the range the scanner has on the battle field.

Parameters:
the  range of the short range scan abilities

virtual bool TScanner::load TDataPackageList   in [virtual]
 

The method Load loads a TScanner object from the data packages in the list. All sub classes of TScanner have to reimplement the Load method and they must call TScanner::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 TScannerNormalActive, TScannerNormalPassive, TScannerAntiDisguiseActive, TScannerAntiDisguisePassive, TScannerAntiCloakActive, TScannerAntiCloakPassive, TScannerPenetrateActive, and TScannerPenetratePassive.

virtual TScanner& TScanner::operator= const TScanner &    Scanner [protected, virtual]
 

The assignment operator for TScanner

virtual bool TScanner::operator== const TScanner &    Scanner const [virtual]
 

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

Parameters:
Scanner  the TScanner object which shall be compared with "*this"
Returns:
true if TScanner objects are euqal, false if not

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

The method Save saves a TScanner object by adding the data packages to the list. All sub classes of TScanner have to reimplement the Save method and they must call TScanner::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 TScannerNormalActive, TScannerNormalPassive, TScannerAntiDisguiseActive, TScannerAntiDisguisePassive, TScannerAntiCloakActive, TScannerAntiCloakPassive, TScannerPenetrateActive, and TScannerPenetratePassive.

virtual void TScanner::setLongRange int2    Range [virtual]
 

With the method setLongRange you can set the range of the long range scan ability of the scanner. This is the range the scanner has on the star map.

Parameters:
Range  the new range for the long range scan abilities

virtual void TScanner::setScanEfficiency const int2    ScanEfficiency [virtual]
 

The method setScanEfficiency sets the efficiency of the scanner. 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:
ScanEfficiency  the scanner's efficiency

virtual void TScanner::setShortRange int4    Range [virtual]
 

With the method setShortRange you can set the range of the short range scan ability of the scanner. This is the range the scanner has on the battle field.

Parameters:
Range  the new range for the short range scan abilities


Member Data Documentation

int2 TScanner::fLongRange [protected]
 

the range of the long range scan abilities (star map)

int2 TScanner::fScanEfficiency [protected]
 

the scanner's efficiency

int4 TScanner::fShortRange [protected]
 

the range of the short range scan abilities (battle field)


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