Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PowerSource Class Reference

#include <Power.h>

Inheritance diagram for PowerSource:
System

List of all members.

Public Types

enum  SUBTYPE { BATTERY, AUX, FUSION }
- Public Types inherited from System
enum  CATEGORY {
  MISC_SYSTEM = 0, DRIVE = 1, WEAPON, SHIELD,
  SENSOR, COMPUTER, POWER_SOURCE, FLIGHT_DECK,
  FARCASTER
}
enum  STATUS {
  DESTROYED, CRITICAL, DEGRADED, NOMINAL,
  MAINT
}
enum  POWER_FLAGS { POWER_WATTS = 1, POWER_CRITICAL = 2 }

Public Member Functions

 PowerSource (SUBTYPE s, double max_output, double fuel_ratio=0)
 PowerSource (const PowerSource &rhs)
virtual void ExecFrame (double seconds)
void AddClient (System *client)
void RemoveClient (System *client)
List< System > & Clients ()
virtual int Charge () const
virtual void SetFuelRange (double hours)
bool RouteChanged () const
void RouteScanned ()
virtual void SetPowerLevel (double level)
virtual void SetOverride (bool over)
virtual void DrainPower (double to_level)
- Public Member Functions inherited from System
 System (CATEGORY t, int s, const char *n, int maxv, double energy=0, double capacity=100, double sink_rate=1)
 System (const System &s)
virtual ~System ()
int operator== (const System &s) const
CATEGORY Type () const
int Subtype () const
const char * Name () const
const char * Abbreviation () const
void SetName (const char *n)
void SetAbbreviation (const char *a)
void SetDesign (SystemDesign *d)
virtual int Value () const
int MaxValue () const
STATUS Status () const
double Availability () const
double Safety () const
double Stability () const
virtual void CalcStatus ()
virtual void Repair ()
double NetAvail () const
void SetNetAvail (double d)
List< Component > & GetComponents ()
virtual void ApplyDamage (double damage)
virtual void ExecMaintFrame (double seconds)
virtual void DoEMCON (int emcon)
virtual void Orient (const Physical *rep)
virtual void Mount (Point loc, float radius, float hull_factor=0.5f)
virtual void Mount (const System &system)
Point MountLocation () const
double Radius () const
double HullProtection () const
bool IsPowerCritical () const
bool UsesWatts () const
virtual double GetRequest (double seconds) const
virtual void Distribute (double delivered_energy, double seconds)
int GetSourceIndex () const
void SetSourceIndex (int i)
bool IsPowerOn () const
virtual void PowerOn ()
virtual void PowerOff ()
virtual double GetPowerLevel () const
void SetCapacity (double c)
double GetCapacity () const
double GetEnergy () const
double GetSinkRate () const
void SetEMCONPower (int emcon, int power_level)
int GetEMCONPower (int emcon)
int GetExplosionType () const
void SetExplosionType (int t)
ShipGetShip () const
void SetShip (Ship *s)
int GetID () const
void SetID (int n)

Protected Attributes

float max_output
float fuel_ratio
List< Systemclients
bool route_changed
float requested_power_level
- Protected Attributes inherited from System
CATEGORY type
Shipship
int id
int subtype
int max_value
Text name
Text abrv
STATUS status
float crit_level
float availability
float safety
float stability
float safety_overload
float net_avail
Point mount_loc
Point mount_rel
float radius
float hull_factor
float energy
float capacity
float sink_rate
float power_level
int source_index
DWORD power_flags
bool power_on
BYTE emcon_power [3]
BYTE emcon
int explosion_type
SystemDesigndesign
List< Componentcomponents

Additional Inherited Members

- Static Public Member Functions inherited from System
static const char * TYPENAME ()

Detailed Description

Definition at line 24 of file Power.h.


Member Enumeration Documentation

Enumerator:
BATTERY 
AUX 
FUSION 

Definition at line 27 of file Power.h.


Constructor & Destructor Documentation

PowerSource::PowerSource ( SUBTYPE  s,
double  max_output,
double  fuel_ratio = 0 
)

Definition at line 32 of file Power.cpp.

PowerSource::PowerSource ( const PowerSource rhs)

Definition at line 57 of file Power.cpp.


Member Function Documentation

void PowerSource::AddClient ( System client)

Definition at line 69 of file Power.cpp.

int PowerSource::Charge ( ) const
virtual

Reimplemented from System.

Definition at line 96 of file Power.cpp.

List<System>& PowerSource::Clients ( )
inline

Definition at line 37 of file Power.h.

void PowerSource::DrainPower ( double  to_level)
virtual

Reimplemented from System.

Definition at line 296 of file Power.cpp.

void PowerSource::ExecFrame ( double  seconds)
virtual

Reimplemented from System.

Definition at line 111 of file Power.cpp.

void PowerSource::RemoveClient ( System client)

Definition at line 84 of file Power.cpp.

bool PowerSource::RouteChanged ( ) const
inline

Definition at line 43 of file Power.h.

void PowerSource::RouteScanned ( )
inline

Definition at line 44 of file Power.h.

void PowerSource::SetFuelRange ( double  hours)
virtual

Definition at line 102 of file Power.cpp.

void PowerSource::SetOverride ( bool  over)
virtual

Reimplemented from System.

Definition at line 277 of file Power.cpp.

void PowerSource::SetPowerLevel ( double  level)
virtual

Reimplemented from System.

Definition at line 253 of file Power.cpp.


Member Data Documentation

List<System> PowerSource::clients
protected

Definition at line 56 of file Power.h.

float PowerSource::fuel_ratio
protected

Definition at line 55 of file Power.h.

float PowerSource::max_output
protected

Definition at line 54 of file Power.h.

float PowerSource::requested_power_level
protected

Definition at line 58 of file Power.h.

bool PowerSource::route_changed
protected

Definition at line 57 of file Power.h.


The documentation for this class was generated from the following files: