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

#include <Hangar.h>

Inheritance diagram for Hangar:
SimObserver

List of all members.

Public Types

enum  HANGAR_STATE {
  UNAVAIL = -2, MAINT = -1, STORAGE = 0, PREP,
  ALERT, QUEUED, LOCKED, LAUNCH,
  ACTIVE, APPROACH, RECOVERY
}
enum  CONSTANTS { MAX_SQUADRONS = 10 }

Public Member Functions

 Hangar ()
 Hangar (const Hangar &rhs)
virtual ~Hangar ()
virtual void ExecFrame (double seconds)
void SetShip (Ship *s)
virtual bool CreateSquadron (Text squadron, CombatGroup *g, const ShipDesign *design, int count, int iff=-1, int *def_load=0, int maint_count=0, int dead_count=0)
virtual bool GotoActiveFlight (int squadron, int slot, Element *elem, int *loadout)
virtual bool GotoAlert (int squadron, int slot, FlightDeck *d, Element *elem=0, int *loadout=0, bool pkg=false, bool expedite=false)
virtual bool Ready (int squadron, int slot, FlightDeck *d)
virtual bool Launch (int squadron, int slot)
virtual bool StandDown (int squadron, int slot)
virtual bool CanStow (Ship *s)
virtual bool Stow (Ship *s)
virtual bool FindSlot (Ship *s, int &squadron, int &slot, int state=UNAVAIL)
virtual bool FindSquadronAndSlot (Ship *s, int &squadron, int &slot)
virtual bool FindAvailSlot (const ShipDesign *s, int &squadron, int &slot)
virtual bool FinishPrep (HangarSlot *slot)
virtual void SetAllIFF (int iff)
virtual bool Update (SimObject *obj)
virtual const char * GetObserverName () const
int NumSquadrons () const
Text SquadronName (int n) const
int SquadronSize (int n) const
int SquadronIFF (int n) const
const ShipDesignSquadronDesign (int n) const
int NumShipsReady (int squadron) const
int NumShipsMaint (int squadron) const
int NumShipsDead (int squadron) const
int NumSlotsEmpty () const
int GetActiveElements (List< Element > &active_list)
const HangarSlotGetSlot (int squadron, int index) const
ShipGetShip (const HangarSlot *s) const
const ShipDesignGetDesign (const HangarSlot *s) const
FlightDeckGetFlightDeck (const HangarSlot *s) const
int GetFlightDeckSlot (const HangarSlot *s) const
int GetState (const HangarSlot *s) const
double TimeRemaining (const HangarSlot *s) const
ElementGetPackageElement (const HangarSlot *s) const
const int * GetLoadout (const HangarSlot *s) const
Text StatusName (const HangarSlot *s) const
int PreflightQueue (FlightDeck *d) const
DWORD GetLastPatrolLaunch () const
void SetLastPatrolLaunch (DWORD t)
- 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 Attributes

Shipship
int nsquadrons
int nslots [MAX_SQUADRONS]
Text names [MAX_SQUADRONS]
HangarSlotsquadrons [MAX_SQUADRONS]
DWORD last_patrol_launch
- Protected Attributes inherited from SimObserver
List< SimObjectobserve_list

Additional Inherited Members

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

Detailed Description

Definition at line 38 of file Hangar.h.


Member Enumeration Documentation

Enumerator:
MAX_SQUADRONS 

Definition at line 58 of file Hangar.h.

Enumerator:
UNAVAIL 
MAINT 
STORAGE 
PREP 
ALERT 
QUEUED 
LOCKED 
LAUNCH 
ACTIVE 
APPROACH 
RECOVERY 

Definition at line 45 of file Hangar.h.


Constructor & Destructor Documentation

Hangar::Hangar ( )

Definition at line 78 of file Hangar.cpp.

Hangar::Hangar ( const Hangar rhs)

Definition at line 87 of file Hangar.cpp.

Hangar::~Hangar ( )
virtual

Definition at line 96 of file Hangar.cpp.


Member Function Documentation

bool Hangar::CanStow ( Ship s)
virtual

Definition at line 484 of file Hangar.cpp.

bool Hangar::CreateSquadron ( Text  squadron,
CombatGroup g,
const ShipDesign design,
int  count,
int  iff = -1,
int *  def_load = 0,
int  maint_count = 0,
int  dead_count = 0 
)
virtual

Definition at line 294 of file Hangar.cpp.

void Hangar::ExecFrame ( double  seconds)
virtual

Definition at line 105 of file Hangar.cpp.

bool Hangar::FindAvailSlot ( const ShipDesign s,
int &  squadron,
int &  slot 
)
virtual

Definition at line 620 of file Hangar.cpp.

bool Hangar::FindSlot ( Ship s,
int &  squadron,
int &  slot,
int  state = UNAVAIL 
)
virtual

Definition at line 532 of file Hangar.cpp.

bool Hangar::FindSquadronAndSlot ( Ship s,
int &  squadron,
int &  slot 
)
virtual

Definition at line 598 of file Hangar.cpp.

bool Hangar::FinishPrep ( HangarSlot slot)
virtual

Definition at line 202 of file Hangar.cpp.

int Hangar::GetActiveElements ( List< Element > &  active_list)

Definition at line 886 of file Hangar.cpp.

const ShipDesign * Hangar::GetDesign ( const HangarSlot s) const

Definition at line 720 of file Hangar.cpp.

FlightDeck * Hangar::GetFlightDeck ( const HangarSlot s) const

Definition at line 727 of file Hangar.cpp.

int Hangar::GetFlightDeckSlot ( const HangarSlot s) const

Definition at line 734 of file Hangar.cpp.

DWORD Hangar::GetLastPatrolLaunch ( ) const

Definition at line 907 of file Hangar.cpp.

const int * Hangar::GetLoadout ( const HangarSlot s) const

Definition at line 762 of file Hangar.cpp.

const char * Hangar::GetObserverName ( ) const
virtual

Reimplemented from SimObserver.

Definition at line 281 of file Hangar.cpp.

Element * Hangar::GetPackageElement ( const HangarSlot s) const

Definition at line 755 of file Hangar.cpp.

Ship * Hangar::GetShip ( const HangarSlot s) const

Definition at line 713 of file Hangar.cpp.

const HangarSlot * Hangar::GetSlot ( int  squadron,
int  index 
) const

Definition at line 701 of file Hangar.cpp.

int Hangar::GetState ( const HangarSlot s) const

Definition at line 741 of file Hangar.cpp.

bool Hangar::GotoActiveFlight ( int  squadron,
int  slot,
Element elem,
int *  loadout 
)
virtual

Definition at line 332 of file Hangar.cpp.

bool Hangar::GotoAlert ( int  squadron,
int  slot,
FlightDeck d,
Element elem = 0,
int *  loadout = 0,
bool  pkg = false,
bool  expedite = false 
)
virtual

Definition at line 386 of file Hangar.cpp.

bool Hangar::Launch ( int  squadron,
int  slot 
)
virtual

Definition at line 412 of file Hangar.cpp.

int Hangar::NumShipsDead ( int  squadron) const

Definition at line 850 of file Hangar.cpp.

int Hangar::NumShipsMaint ( int  squadron) const

Definition at line 833 of file Hangar.cpp.

int Hangar::NumShipsReady ( int  squadron) const

Definition at line 816 of file Hangar.cpp.

int Hangar::NumSlotsEmpty ( ) const

Definition at line 867 of file Hangar.cpp.

int Hangar::NumSquadrons ( ) const
inline

Definition at line 86 of file Hangar.h.

int Hangar::PreflightQueue ( FlightDeck d) const

Definition at line 795 of file Hangar.cpp.

bool Hangar::Ready ( int  squadron,
int  slot,
FlightDeck d 
)
virtual

Definition at line 642 of file Hangar.cpp.

void Hangar::SetAllIFF ( int  iff)
virtual

Definition at line 921 of file Hangar.cpp.

void Hangar::SetLastPatrolLaunch ( DWORD  t)

Definition at line 913 of file Hangar.cpp.

void Hangar::SetShip ( Ship s)
inline

Definition at line 61 of file Hangar.h.

const ShipDesign * Hangar::SquadronDesign ( int  n) const

Definition at line 692 of file Hangar.cpp.

int Hangar::SquadronIFF ( int  n) const

Definition at line 683 of file Hangar.cpp.

Text Hangar::SquadronName ( int  n) const

Definition at line 665 of file Hangar.cpp.

int Hangar::SquadronSize ( int  n) const

Definition at line 674 of file Hangar.cpp.

bool Hangar::StandDown ( int  squadron,
int  slot 
)
virtual

Definition at line 425 of file Hangar.cpp.

Text Hangar::StatusName ( const HangarSlot s) const

Definition at line 769 of file Hangar.cpp.

bool Hangar::Stow ( Ship s)
virtual

Definition at line 498 of file Hangar.cpp.

double Hangar::TimeRemaining ( const HangarSlot s) const

Definition at line 748 of file Hangar.cpp.

bool Hangar::Update ( SimObject obj)
virtual

Reimplemented from SimObserver.

Definition at line 251 of file Hangar.cpp.


Member Data Documentation

DWORD Hangar::last_patrol_launch
protected

Definition at line 120 of file Hangar.h.

Text Hangar::names[MAX_SQUADRONS]
protected

Definition at line 118 of file Hangar.h.

int Hangar::nslots[MAX_SQUADRONS]
protected

Definition at line 117 of file Hangar.h.

int Hangar::nsquadrons
protected

Definition at line 116 of file Hangar.h.

Ship* Hangar::ship
protected

Definition at line 115 of file Hangar.h.

HangarSlot* Hangar::squadrons[MAX_SQUADRONS]
protected

Definition at line 119 of file Hangar.h.


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