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

#include <Shield.h>

Inheritance diagram for Shield:
System

List of all members.

Public Types

enum  SUBTYPE { DEFLECTOR = 1, GRAV_SHIELD, HYPER_SHIELD }
- 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

 Shield (SUBTYPE s)
 Shield (const Shield &rhs)
virtual ~Shield ()
virtual void ExecFrame (double seconds)
double DeflectDamage (Shot *shot, double shot_damage)
double ShieldLevel () const
double ShieldFactor () const
double ShieldCurve () const
void SetShieldFactor (double f)
void SetShieldCurve (double c)
double ShieldCutoff () const
void SetShieldCutoff (double f)
double Capacity () const
double Consumption () const
void SetConsumption (double r)
bool ShieldCapacitor () const
void SetShieldCapacitor (bool c)
bool ShieldBubble () const
void SetShieldBubble (bool b)
double DeflectionCost () const
void SetDeflectionCost (double c)
virtual void SetPowerLevel (double level)
virtual void SetNetShieldLevel (int level)
virtual void Distribute (double delivered_energy, double seconds)
virtual void DoEMCON (int emcon)
- 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 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
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 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)

Protected Attributes

bool shield_capacitor
bool shield_bubble
float shield_factor
float shield_level
float shield_curve
float shield_cutoff
float requested_power_level
float deflection_cost
- 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 29 of file Shield.h.


Member Enumeration Documentation

Enumerator:
DEFLECTOR 
GRAV_SHIELD 
HYPER_SHIELD 

Definition at line 32 of file Shield.h.


Constructor & Destructor Documentation

Shield::Shield ( SUBTYPE  s)

Definition at line 37 of file Shield.cpp.

Shield::Shield ( const Shield rhs)

Definition at line 75 of file Shield.cpp.

Shield::~Shield ( )
virtual

Definition at line 91 of file Shield.cpp.


Member Function Documentation

double Shield::Capacity ( ) const
inline

Definition at line 48 of file Shield.h.

double Shield::Consumption ( ) const
inline

Definition at line 49 of file Shield.h.

double Shield::DeflectDamage ( Shot shot,
double  shot_damage 
)

Definition at line 168 of file Shield.cpp.

double Shield::DeflectionCost ( ) const
inline

Definition at line 55 of file Shield.h.

void Shield::Distribute ( double  delivered_energy,
double  seconds 
)
virtual

Reimplemented from System.

Definition at line 138 of file Shield.cpp.

void Shield::DoEMCON ( int  emcon)
virtual

Reimplemented from System.

Definition at line 242 of file Shield.cpp.

void Shield::ExecFrame ( double  seconds)
virtual

Reimplemented from System.

Definition at line 112 of file Shield.cpp.

void Shield::SetConsumption ( double  r)
inline

Definition at line 50 of file Shield.h.

void Shield::SetDeflectionCost ( double  c)
inline

Definition at line 56 of file Shield.h.

void Shield::SetNetShieldLevel ( int  level)
virtual

Definition at line 232 of file Shield.cpp.

void Shield::SetPowerLevel ( double  level)
virtual

Reimplemented from System.

Definition at line 209 of file Shield.cpp.

void Shield::SetShieldBubble ( bool  b)
inline

Definition at line 54 of file Shield.h.

void Shield::SetShieldCapacitor ( bool  c)

Definition at line 95 of file Shield.cpp.

void Shield::SetShieldCurve ( double  c)
inline

Definition at line 45 of file Shield.h.

void Shield::SetShieldCutoff ( double  f)
inline

Definition at line 47 of file Shield.h.

void Shield::SetShieldFactor ( double  f)
inline

Definition at line 44 of file Shield.h.

bool Shield::ShieldBubble ( ) const
inline

Definition at line 53 of file Shield.h.

bool Shield::ShieldCapacitor ( ) const
inline

Definition at line 51 of file Shield.h.

double Shield::ShieldCurve ( ) const
inline

Definition at line 43 of file Shield.h.

double Shield::ShieldCutoff ( ) const
inline

Definition at line 46 of file Shield.h.

double Shield::ShieldFactor ( ) const
inline

Definition at line 42 of file Shield.h.

double Shield::ShieldLevel ( ) const
inline

Definition at line 41 of file Shield.h.


Member Data Documentation

float Shield::deflection_cost
protected

Definition at line 73 of file Shield.h.

float Shield::requested_power_level
protected

Definition at line 72 of file Shield.h.

bool Shield::shield_bubble
protected

Definition at line 67 of file Shield.h.

bool Shield::shield_capacitor
protected

Definition at line 66 of file Shield.h.

float Shield::shield_curve
protected

Definition at line 70 of file Shield.h.

float Shield::shield_cutoff
protected

Definition at line 71 of file Shield.h.

float Shield::shield_factor
protected

Definition at line 68 of file Shield.h.

float Shield::shield_level
protected

Definition at line 69 of file Shield.h.


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