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

#include <Drive.h>

Inheritance diagram for Drive:
System

List of all members.

Public Types

enum  SUBTYPE {
  PLASMA, FUSION, GREEN, RED,
  BLUE, YELLOW, STEALTH
}
enum  Constants { MAX_ENGINES = 16 }
- 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

 Drive (SUBTYPE s, float max_thrust, float max_aug, bool show_trail=true)
 Drive (const Drive &rhs)
virtual ~Drive ()
float Thrust (double seconds)
float MaxThrust () const
float MaxAugmenter () const
int NumEngines () const
DriveSpriteGetFlare (int port) const
BoltGetTrail (int port) const
bool IsAugmenterOn () const
virtual void AddPort (const Point &loc, float flare_scale=0)
virtual void CreatePort (const Point &loc, float flare_scale)
virtual void Orient (const Physical *rep)
void SetThrottle (double t, bool aug=false)
virtual double GetRequest (double seconds) const
- 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 ExecFrame (double seconds)
virtual void ExecMaintFrame (double seconds)
virtual void DoEMCON (int emcon)
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 void Distribute (double delivered_energy, double seconds)
int GetSourceIndex () const
void SetSourceIndex (int i)
virtual int Charge () const
bool IsPowerOn () const
virtual void PowerOn ()
virtual void PowerOff ()
virtual double GetPowerLevel () const
virtual void SetPowerLevel (double level)
virtual void SetOverride (bool over)
virtual void DrainPower (double to_level)
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)

Static Public Member Functions

static void Initialize ()
static void Close ()
static void StartFrame ()
- Static Public Member Functions inherited from System
static const char * TYPENAME ()

Protected Attributes

float thrust
float augmenter
float scale
float throttle
float augmenter_throttle
float intensity
List< DrivePortports
Soundsound
Soundburner_sound
bool show_trail
- 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

Detailed Description

Definition at line 47 of file Drive.h.


Member Enumeration Documentation

Enumerator:
MAX_ENGINES 

Definition at line 51 of file Drive.h.

Enumerator:
PLASMA 
FUSION 
GREEN 
RED 
BLUE 
YELLOW 
STEALTH 

Definition at line 50 of file Drive.h.


Constructor & Destructor Documentation

Drive::Drive ( SUBTYPE  s,
float  max_thrust,
float  max_aug,
bool  show_trail = true 
)

Definition at line 64 of file Drive.cpp.

Drive::Drive ( const Drive rhs)

Definition at line 93 of file Drive.cpp.

Drive::~Drive ( )
virtual

Definition at line 112 of file Drive.cpp.


Member Function Documentation

void Drive::AddPort ( const Point loc,
float  flare_scale = 0 
)
virtual

Definition at line 204 of file Drive.cpp.

void Drive::Close ( )
static

Definition at line 186 of file Drive.cpp.

void Drive::CreatePort ( const Point loc,
float  flare_scale 
)
virtual

Definition at line 214 of file Drive.cpp.

DriveSprite * Drive::GetFlare ( int  port) const

Definition at line 357 of file Drive.cpp.

double Drive::GetRequest ( double  seconds) const
virtual

Reimplemented from System.

Definition at line 330 of file Drive.cpp.

Bolt * Drive::GetTrail ( int  port) const

Definition at line 367 of file Drive.cpp.

void Drive::Initialize ( )
static

Definition at line 132 of file Drive.cpp.

bool Drive::IsAugmenterOn ( ) const

Definition at line 340 of file Drive.cpp.

float Drive::MaxAugmenter ( ) const
inline

Definition at line 63 of file Drive.h.

float Drive::MaxThrust ( ) const
inline

Definition at line 62 of file Drive.h.

int Drive::NumEngines ( ) const

Definition at line 351 of file Drive.cpp.

void Drive::Orient ( const Physical rep)
virtual

Reimplemented from System.

Definition at line 248 of file Drive.cpp.

void Drive::SetThrottle ( double  t,
bool  aug = false 
)

Definition at line 287 of file Drive.cpp.

void Drive::StartFrame ( )
static

Definition at line 197 of file Drive.cpp.

float Drive::Thrust ( double  seconds)

Definition at line 379 of file Drive.cpp.


Member Data Documentation

float Drive::augmenter
protected

Definition at line 79 of file Drive.h.

float Drive::augmenter_throttle
protected

Definition at line 82 of file Drive.h.

Sound* Drive::burner_sound
protected

Definition at line 88 of file Drive.h.

float Drive::intensity
protected

Definition at line 83 of file Drive.h.

List<DrivePort> Drive::ports
protected

Definition at line 85 of file Drive.h.

float Drive::scale
protected

Definition at line 80 of file Drive.h.

bool Drive::show_trail
protected

Definition at line 89 of file Drive.h.

Sound* Drive::sound
protected

Definition at line 87 of file Drive.h.

float Drive::throttle
protected

Definition at line 81 of file Drive.h.

float Drive::thrust
protected

Definition at line 78 of file Drive.h.


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