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

#include <Sensor.h>

Inheritance diagram for Sensor:
System SimObserver

List of all members.

Public Types

enum  Mode {
  PAS, STD, ACM, GM,
  PST, CST
}
- 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

 Sensor ()
 Sensor (const Sensor &rhs)
virtual ~Sensor ()
virtual void ExecFrame (double seconds)
virtual SimObjectLockTarget (int type=SimObject::SIM_SHIP, bool closest=false, bool hostile=false)
virtual SimObjectLockTarget (SimObject *candidate)
virtual bool IsTracking (SimObject *tgt)
virtual void DoEMCON (int emcon)
virtual void ClearAllContacts ()
virtual Mode GetMode () const
virtual void SetMode (Mode m)
virtual double GetBeamLimit () const
virtual double GetBeamRange () const
virtual void IncreaseRange ()
virtual void DecreaseRange ()
virtual void AddRange (double r)
ContactFindContact (Ship *s)
ContactFindContact (Shot *s)
SimObjectAcquirePassiveTargetForMissile ()
SimObjectAcquireActiveTargetForMissile ()
virtual bool Update (SimObject *obj)
virtual const char * GetObserverName () 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 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
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)
- Public Member Functions inherited from SimObserver
virtual ~SimObserver ()
int operator== (const SimObserver &o) const
virtual void Observe (SimObject *obj)
virtual void Ignore (SimObject *obj)

Protected Member Functions

void ProcessContact (Ship *contact, double az1, double az2)
void ProcessContact (Shot *contact, double az1, double az2)

Protected Attributes

Mode mode
int nsettings
int range_index
float range_settings [8]
SimObjecttarget
List< Contactcontacts
- 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
- Protected Attributes inherited from SimObserver
List< SimObjectobserve_list

Additional Inherited Members

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

Detailed Description

Definition at line 31 of file Sensor.h.


Member Enumeration Documentation

Enumerator:
PAS 
STD 
ACM 
GM 
PST 
CST 

Definition at line 34 of file Sensor.h.


Constructor & Destructor Documentation

Sensor::Sensor ( )

Definition at line 36 of file Sensor.cpp.

Sensor::Sensor ( const Sensor rhs)

Definition at line 52 of file Sensor.cpp.

Sensor::~Sensor ( )
virtual

Definition at line 69 of file Sensor.cpp.


Member Function Documentation

SimObject * Sensor::AcquireActiveTargetForMissile ( )

Definition at line 784 of file Sensor.cpp.

SimObject * Sensor::AcquirePassiveTargetForMissile ( )

Definition at line 750 of file Sensor.cpp.

void Sensor::AddRange ( double  r)
virtual

Definition at line 121 of file Sensor.cpp.

void Sensor::ClearAllContacts ( )
virtual

Definition at line 77 of file Sensor.cpp.

void Sensor::DecreaseRange ( )
virtual

Definition at line 112 of file Sensor.cpp.

void Sensor::DoEMCON ( int  emcon)
virtual

Reimplemented from System.

Definition at line 817 of file Sensor.cpp.

void Sensor::ExecFrame ( double  seconds)
virtual

Reimplemented from System.

Definition at line 171 of file Sensor.cpp.

Contact * Sensor::FindContact ( Ship s)

Definition at line 535 of file Sensor.cpp.

Contact * Sensor::FindContact ( Shot s)

Definition at line 548 of file Sensor.cpp.

double Sensor::GetBeamLimit ( ) const
virtual

Definition at line 85 of file Sensor.cpp.

double Sensor::GetBeamRange ( ) const
virtual

Definition at line 97 of file Sensor.cpp.

virtual Mode Sensor::GetMode ( ) const
inlinevirtual

Definition at line 53 of file Sensor.h.

const char * Sensor::GetObserverName ( ) const
virtual

Reimplemented from SimObserver.

Definition at line 163 of file Sensor.cpp.

void Sensor::IncreaseRange ( )
virtual

Definition at line 103 of file Sensor.cpp.

bool Sensor::IsTracking ( SimObject tgt)
virtual

Definition at line 563 of file Sensor.cpp.

SimObject * Sensor::LockTarget ( int  type = SimObject::SIM_SHIP,
bool  closest = false,
bool  hostile = false 
)
virtual

Definition at line 602 of file Sensor.cpp.

SimObject * Sensor::LockTarget ( SimObject candidate)
virtual

Definition at line 706 of file Sensor.cpp.

void Sensor::ProcessContact ( Ship contact,
double  az1,
double  az2 
)
protected

Definition at line 311 of file Sensor.cpp.

void Sensor::ProcessContact ( Shot contact,
double  az1,
double  az2 
)
protected

Definition at line 458 of file Sensor.cpp.

void Sensor::SetMode ( Mode  m)
virtual

Definition at line 130 of file Sensor.cpp.

bool Sensor::Update ( SimObject obj)
virtual

Reimplemented from SimObserver.

Definition at line 153 of file Sensor.cpp.


Member Data Documentation

List<Contact> Sensor::contacts
protected

Definition at line 82 of file Sensor.h.

Mode Sensor::mode
protected

Definition at line 76 of file Sensor.h.

int Sensor::nsettings
protected

Definition at line 77 of file Sensor.h.

int Sensor::range_index
protected

Definition at line 78 of file Sensor.h.

float Sensor::range_settings[8]
protected

Definition at line 79 of file Sensor.h.

SimObject* Sensor::target
protected

Definition at line 80 of file Sensor.h.


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