#include <subfleet.h>
Inheritance diagram for TSubFleet:
Public Methods | |
TSubFleet (TShipDesign *ShipDesign, int2 NumberOfShips) | |
TSubFleet (TSubFleet &OldSubFleet) | |
virtual | ~TSubFleet () |
virtual int2 | getType () const |
virtual const string & | getTypeName () const |
virtual const TFleet * | getFleet () const |
virtual const TShipDesign * | getShipDesign () const |
virtual void | AddShips (int4 NumberOfShips) |
virtual void | SubstractShips (int4 NumberOfShips) |
virtual int4 | getNumberOfShips () const |
virtual void | setAutoUpgrade (TShipDesign *UpgradeDesign) |
virtual TShipDesign * | getUpgradeDesign () const |
virtual void | CancelAutoUpgrade () |
virtual bool | getUpgradeCosts (TSubstanceSet *UpgradeCosts) const=0 |
virtual bool | CommitAutoUpgrade () |
virtual void | setAutoRetire () |
virtual void | CancelAutoRetire () |
virtual bool | IsAutoRetire () const |
virtual void | getRepairCost (TSubstanceSet *RepairCost) const=0 |
virtual void | RepairSubfleet ()=0 |
virtual void | setExperience (int4 Experience) |
virtual int4 | getExperience () const |
virtual int4 | getMaxHullHP () const |
virtual int4 | getMaxArmorHP () const |
virtual int4 | getMaxShieldHP () const |
virtual int4 | getActualHullHP () const=0 |
virtual int4 | getFTLFuelConsumption (double Speed, double Distance=1) const=0 |
virtual double | getFTLMaxSpeed () const=0 |
virtual double | getFTLMovementDistance (double dSpeed) const=0 |
virtual double | getFTLBreakDownProbability (double Speed) const=0 |
virtual double | getLongScannerRange (TScanner::tScannerType ScannerType) const=0 |
virtual void | setFuel (int4 Fuel)=0 |
virtual int4 | getFuel () const=0 |
virtual int4 | getCargoSpace () const |
virtual bool | IsColonizer () const=0 |
virtual int2 | getMiningRate () const |
virtual bool | load (TDataPackageList *in) |
virtual bool | save (TDataPackageList *out) const |
virtual TSubFleet & | operator= (const TSubFleet &SubFleet) |
Protected Methods | |
virtual void | setFleet (TFleet *NewFleet) |
Protected Attributes | |
TLink< TFleet > | fFleet |
TLink< TShipDesign > | fShipDesign |
TLink< TShipDesign > | fUpgradeDesign |
int4 | fNumberOfShips |
int4 | fExperience |
bool | fAutoRetire |
Friends | |
class | TFleet |
|
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.
|
|
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.
|
|
The destructor is doing nothing special at the moment. |
|
With the method AddShips you can add ships to the subfleet. The method doesn't complain about, if the number of new ships is 0.
|
|
With the method CancelAutoRetire you can delete the flag, which determines whether the subfleet is to be retired at the next opportunity. That means, the auto reiterment is canceld.
|
|
With the method CancelAutoUpgrade you can cancel an ordered auto upgrade. Also the link to the upgrade design will be deleted, so that if you want to set up a new auto upgrade, you have to give the wished design again. |
|
With the method CommitAutoUpgrade you can commit an ordered auto upgrade. Also the link to the upgrade design will be deleted (it is no longer needed) so that if you want to set up a new auto upgrade, you have to give the wished design again. The method will return a bool value, whether an upgrade was planned and commited (if one was planned it is commited after this method). Because this method doesn't care, whether you are able to pay the costs or not, make sure only to call it, when you already have payed the costs.
|
|
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.
Reimplemented in TSubFleetBasic. |
|
With the method getCargoSpace you can get the amount of cargo space of the subfleet (as integer value).
|
|
With the method getExperience you can get the amount of experience the subfleet or rather its crew has.
|
|
With the method getFleet you can get the "parent" fleet, the subfleet is belonging to.
|
|
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?
Reimplemented in TSubFleetBasic. |
|
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.
Reimplemented in TSubFleetBasic. |
|
With the method getMaxSpeed you can get the maximum speed the sublfeet is able to travel with.
Reimplemented in TSubFleetBasic. |
|
With the method getMovementDistance you can get the distance the subfleet can travel within one turen with the given speed.
Reimplemented in TSubFleetBasic. |
|
With the method getFuel you can get the amount of fuel the subfleet has still left.
Reimplemented in TSubFleetBasic. |
|
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.
Reimplemented in TSubFleetBasic. |
|
With this method you can get the maximum amount of armor hit points the sub fleet has (in undamaged condition). The amount is returned without taking in calculation different armor types.
|
|
With this method you can get the maximum amount of hull hit points the sub fleet has (in undamaged condition).
|
|
With this method you can get the maximum amount of shield hit points the sub fleet has (in undamaged condition). The amount is returned without taking in calculation different shield types.
|
|
With the method getMiningRate you can get the mineral mining rate of the subfleet. It is simply the value of the ship design multiplied with the number of ships in the subfleet.
|
|
|
|
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 value will be returned in the parameter RepairCost.
Reimplemented in TSubFleetBasic. |
|
With the method getShipDesign you can get the ship design the ships in the subfleet are from.
|
|
This method is inherited from TType and reimplemented here. I returns TType::SUBFLEET.
Reimplemented from TLinkable. |
|
This method is inherited from TType and reimplemented here. I returns "TSubFleet".
Reimplemented from TLinkable. |
|
With the method getUpgradeCosts you can get the costs the planned upgrade will cost. The costs are returned in the paremeter UpgradeCosts. Furthermore the method returns, whether there is an upgrade planned.
Reimplemented in TSubFleetBasic. |
|
With the method getUpgradeDesign you can get the pointer to the ship design, the subfleet shall be upgraded to. If there is no such design, because no auto upgrade si planned, the method will return the NULL-pointer.
|
|
With the method IsAutoRetire you can get the value of the flag that determines whether the subfleet shoulf be retired at the next opportunity.
|
|
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.
Reimplemented in TSubFleetBasic. |
|
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.
Reimplemented from TActionObject. Reimplemented in TSubFleetBasic. |
|
This is the assignment operator for TSubFleet. 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. |
|
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 in TSubFleetBasic. |
|
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.
Reimplemented from TActionObject. Reimplemented in TSubFleetBasic. |
|
With the method setAutoRetire you can set a flag, which determines whether the subfleet is to be retired at the next opportunity. The flag can be read out with the method IsAutoRetire. The classes which are responsible for the actions of the subfleet has to check at every opportunity (i.e. planet) whether the subfleet is to be retired and if yes, destruct it with the destructor. |
|
With the method setAutoUpgrade you can give the subfleet the ship design it should become upgraded to at the next opportunity. This opportunity is signed the subfleet with the method CommitAutoUpgrade. If there is already one auto upgrade planned, it will be overwritten with the new one.
|
|
With the method setExperience you can set the amount of experience the subfleet or rather its crew has. With growing experience the battle performance of the crew increaes.
|
|
The method setFleet sets the fleet this subfleet belongs to. It doesn't care about whether the new or old parent fleet are informed about it. This method should only be called by TFleet, if the subfleet gets a new parent fleet.
|
|
With the method setFuel you can get the amount of fuel the subfleet has still left.
Reimplemented in TSubFleetBasic. |
|
With the method SubstractShips you can substract ships from the subfleet. The method doesn't complain about, if the number of ships to be substracted is 0. If the number of ships would be become 0 or negative, the method gives a fatal error.
|
|
the flag which determines whether the subfleet is to be auto retired |
|
the amount of experience the crew of the subfleet has |
|
the link to the "parent" fleet |
|
the number of ships in the subfleet |
|
the link to the ship design the ships in the subfleets are of |
|
the link to the ship design the subfleet shall be get upgraded to |