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

TSubFleetBasic Class Reference

The basic rule implemenation for subfleets. More...

#include <subfleet_basic.h>

Inheritance diagram for TSubFleetBasic:

Inheritance graph
[legend]
Collaboration diagram for TSubFleetBasic:

Collaboration graph
[legend]
List of all members.

Public Methods

 TSubFleetBasic (TShipDesign *ShipDesign, int2 NumberOfShips)
 TSubFleetBasic (TSubFleetBasic &OldSubFleet)
virtual ~TSubFleetBasic ()
virtual bool getUpgradeCosts (TSubstanceSet *UpgradeCosts) const
virtual void getRepairCost (TSubstanceSet *RepairCost) const
virtual void RepairSubfleet ()
virtual int4 getActualHullHP () const
virtual int4 getFTLFuelConsumption (double Speed, double Distance=1) const
virtual double getFTLMaxSpeed () const
virtual double getFTLMovementDistance (double Speed) const
virtual double getFTLBreakDownProbability (double Speed) const
virtual double getLongScannerRange (TScanner::tScannerType ScannerType) const
virtual bool IsColonizer () const
virtual void setFuel (int4 Fuel)
virtual int4 getFuel () const
virtual bool load (TDataPackageList *in)
virtual bool save (TDataPackageList *out) const
virtual TSubFleetBasic & operator= (const TSubFleetBasic &SubFleet)

Private Attributes

int2 fFuel

Detailed Description

The basic rule implemenation for subfleets.

Author:
Ralf Laue <ralf.laue@gmx.de>
Version:
Id:
subfleet_basic.h,v 1.4 2002/04/11 21:35:50 prolator Exp
See also:
TFleet, TShipDesign
This is the basic rules implemenation for the pure virtual class TSubFleet. It implements the rule depending methods for a subfleet according to the basic rules (see RFC file for rules).


Constructor & Destructor Documentation

TSubFleetBasic::TSubFleetBasic TShipDesign   ShipDesign,
int2    NumberOfShips
 

This constructor creates and initializes a new subfleet. The ship design the subfleet is of, is given in the parameter. The number of ships the subfleet should have initailly, is given in the second parameter.

Parameters:
ShipDesign  the ship design the subfleet is of
NumberOfShips  the number of ships the subfleet has initially

TSubFleetBasic::TSubFleetBasic TSubFleetBasic &    OldSubFleet
 

This constructor also creates a new subfleet. It is initialized with the values of the subfleet given in the parameter. This is the copy constructor. All values ecxept the fleet are copied. The caller is responsible to inform the fleet about its new subfleet. This fleet will then inform the subfleet about its new parent. FIXME, at the moment the fields of TActioObject are NOT copied.

Parameters:
OldSubFleet  the subfleet the values are copied from

virtual TSubFleetBasic::~TSubFleetBasic   [virtual]
 

This destructor destrcucts the object. It has nothing to do, because the destructor of its parent takes care of everything and it is called automatically.


Member Function Documentation

virtual int4 TSubFleetBasic::getActualHullHP   const [virtual]
 

With the method getActualHullHP you can get the amount if hit points the subfleet still has. You don't get any information how they are distributed over different ships.

Returns:
the amount of hit points the subfleet still has

Reimplemented from TSubFleet.

virtual double TSubFleetBasic::getFTLBreakDownProbability double    Speed const [virtual]
 

With the method getBreakDownProbability you can get the probability of an engine failure for traveling with a certain speed. FIXME, do we differ between STL and FTL travel?

Parameters:
Speed  the speed of the subfleet
Returns:
the probability for an engine failure of subfleet at the given speed .

Reimplemented from TSubFleet.

virtual int4 TSubFleetBasic::getFTLFuelConsumption double    Speed,
double    Distance = 1
const [virtual]
 

With the method getFuelConsumption you can get the amount of fuel a subfleet needs for a given distance with a give speed. The method expacts speed and distance as parameters. The distance can be omitted; then the default value of 1 is chosen.

Parameters:
Speed  the speed of the subfleet wants to travel with
Distance  the distance the subfleet wants to travel
Returns:
the fuel needed for that distance at that speed

Reimplemented from TSubFleet.

virtual double TSubFleetBasic::getFTLMaxSpeed   const [virtual]
 

With the method getMaxSpeed you can get the maximum speed the sublfeet is able to travel with.

Returns:
the maximum speed of the subfleet

Reimplemented from TSubFleet.

virtual double TSubFleetBasic::getFTLMovementDistance double    Speed const [virtual]
 

With the method getMovementDistance you can get the distance the subfleet can travel within one turn with the given speed.

Parameters:
Speed  the speed the subfleet should travel with
Returns:
the distance the subfleet can move with the given speed within one turn

Reimplemented from TSubFleet.

virtual int4 TSubFleetBasic::getFuel   const [virtual]
 

With the method getFuel you can get the amount of fuel the subfleet has still left.

Returns:
the amount of fuel the subfleet has still left

Reimplemented from TSubFleet.

virtual double TSubFleetBasic::getLongScannerRange TScanner::tScannerType    ScannerType const [virtual]
 

With the method getLongScannerRange you can get the maximu scanning range of the long range scanner. That means the range the scanners can scan on the star map, not on the battlefield. The range is return in lightyears.

Returns:
the maximum scn range of the long range scanners in LYs

Reimplemented from TSubFleet.

virtual void TSubFleetBasic::getRepairCost TSubstanceSet   RepairCost const [virtual]
 

With the method getRepairCost you can get the cost for a repair of all damages on hull, armor and other equipment. The cost for new fighters, SP weapons and ammuntion will not be included. The cost vlaue will be returned in the parameter RepairCost.

Parameters:
RepairCost  return variable for the repair cost; it will deleted in any case

Reimplemented from TSubFleet.

virtual bool TSubFleetBasic::getUpgradeCosts TSubstanceSet   UpgradeCosts const [virtual]
 

With the method getUpgradeCosts you can get the costs the planned upgrade will cost. The costs are returned in the paremeter UpgradeCosts. The costs will be 150% of the cost difference between the two designs. If the old design costs more, then the costs will be zero, but you don't get any refund. FIXME, this implementation does not yet look at singel substances, only at the whole set. That means, if the old design is in only one substance more expensive than the new, there will be no costs. Furthermore the method returns, whether there is an upgrade planned.

ameter UpgradeCosts in this substance set the costs for the
upgrade are returned, it will be overwritten in any case, even if now upgrade was planned
Returns:
true if there is an upgrade planned, if not false

Reimplemented from TSubFleet.

virtual bool TSubFleetBasic::IsColonizer   const [virtual]
 

With the method IsColonizer you can get the information whether the ship design of the subfleet contains at least on colonization module. What you do with this information is up to the code, which handles the actual colonization. For example, it could get this information and if positive it decreases the number of ships by one and colonizes the planet.

Returns:
true if colonization module in the design, if not false

Reimplemented from TSubFleet.

virtual bool TSubFleetBasic::load TDataPackageList   in [virtual]
 

The method Load loads a TSubFleet object from the data packages in the list. Additionally it informs the parent fleet about its new subfleet. For more information look in the documentation of the ancestors of TShipDesign from where this method is inherited.

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 TSubFleet.

virtual TSubFleetBasic& TSubFleetBasic::operator= const TSubFleetBasic &    SubFleet [virtual]
 

This is the assignment operator for TSubFleetBasic. It copies all values of the subfleet except the fleet. The caller is responsible to inform the fleet about its new subfleet. This fleet will then inform the subfleet about its new parent. FIXME, at the moment the fields of TActioObject are NOT copied.

virtual void TSubFleetBasic::RepairSubfleet   [virtual]
 

With the method RepairSubfleet you can order the subfleet to repair damages to hull, armor and other equipment. But the stocks of fighters, SP weapons and ammuntion will not be filled up.

Reimplemented from TSubFleet.

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

The method Save saves a TSubFleet by adding the data packages to the list. For more information look in the documentation of the ancestors of TShipDesign, because the method Save is inherited from there.

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 TSubFleet.

virtual void TSubFleetBasic::setFuel int4    Fuel [virtual]
 

FIXME

Reimplemented from TSubFleet.


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