Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Briefing Class Reference

#include <briefing.h>

Classes

class  Ship
 

Public Member Functions

void Render ()
 
void Update ()
 
int AddStarship (const char *filename, int faction, const Vector &)
 
void RemoveStarship (int)
 
void EnqueueOrder (int, const Vector &destination, float time)
 
void OverrideOrder (int, const Vector &destination, float time)
 
void SetPosition (int, const Vector &Position)
 
Vector GetPosition (int)
 
void SetCloak (int, float)
 
 Briefing ()
 
 ~Briefing ()
 

Public Attributes

Camera cam
 
TextPlane tp
 
vector< Ship * > starships
 

Detailed Description

Definition at line 19 of file briefing.h.

Constructor & Destructor Documentation

Briefing::Briefing ( )

Definition at line 109 of file briefing.cpp.

References cam, QVector, Camera::SetOrientation(), TextPlane::SetPos(), Camera::SetPosition(), TextPlane::SetSize(), tp, Vector, and VSCONSTRUCT2.

110 {
111  VSCONSTRUCT2( 'b' )
112  cam.SetPosition( QVector( 0, 0, 0 ), Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
113  cam.SetOrientation( Vector( 1, 0, 0 ), Vector( 0, 1, 0 ), Vector( 0, 0, 1 ) );
114  tp.SetPos( -1, 1 );
115  tp.SetSize( 1, -.5 );
116 }
Briefing::~Briefing ( )

Definition at line 117 of file briefing.cpp.

References i, starships, and VSDESTRUCT2.

118 {
120  for (unsigned int i = 0; i < starships.size(); i++)
121  delete starships[i];
122  starships.clear();
123 }

Member Function Documentation

int Briefing::AddStarship ( const char *  filename,
int  faction,
const Vector pos 
)

Definition at line 151 of file briefing.cpp.

References Briefing::Ship::LoadFailed(), BaseUtil::Ship(), and starships.

Referenced by BriefingUtil::addShip().

152 {
153  Ship *tmp = new Ship( fn, faction, pos );
154  if ( tmp->LoadFailed() ) {
155  delete tmp;
156  return -1;
157  }
158  starships.push_back( tmp );
159  return starships.size()-1;
160 }
void Briefing::EnqueueOrder ( int  which,
const Vector destination,
float  time 
)

Definition at line 130 of file briefing.cpp.

References starships.

Referenced by BriefingUtil::enqueueOrder(), and Briefing::Ship::OverrideOrder().

131 {
132  if (which < (int) starships.size() && which >= 0)
133  starships[which]->EnqueueOrder( dest, time );
134 }
Vector Briefing::GetPosition ( int  which)

Definition at line 145 of file briefing.cpp.

References starships, and Vector.

Referenced by BriefingUtil::getShipPosition().

146 {
147  if (which < (int) starships.size() && which >= 0)
148  return starships[which]->Position();
149  return Vector( 0, 0, 0 );
150 }
void Briefing::OverrideOrder ( int  which,
const Vector destination,
float  time 
)

Definition at line 135 of file briefing.cpp.

References starships.

Referenced by BriefingUtil::replaceOrder().

136 {
137  if (which < (int) starships.size() && which >= 0)
138  starships[which]->OverrideOrder( dest, time );
139 }
void Briefing::RemoveStarship ( int  which)

Definition at line 125 of file briefing.cpp.

References starships.

Referenced by BriefingUtil::removeShip().

126 {
127  if (which < (int) starships.size() && which >= 0)
128  starships[which]->Destroy();
129 }
void Briefing::SetCloak ( int  w,
float  c 
)

Definition at line 17 of file briefing.cpp.

References c, and starships.

Referenced by BriefingUtil::setCloak().

18 {
19  if ( w >= 0 && w < static_cast<int>(starships.size()) )
20  starships[w]->cloak = c;
21 }
void Briefing::SetPosition ( int  which,
const Vector Position 
)

Definition at line 140 of file briefing.cpp.

References starships.

Referenced by BriefingUtil::setShipPosition(), and Briefing::Ship::Update().

141 {
142  if (which < (int) starships.size() && which >= 0)
143  starships[which]->SetPosition( Position );
144 }
void Briefing::Update ( )

Definition at line 161 of file briefing.cpp.

References i, and starships.

Referenced by Mission::BriefingUpdate().

162 {
163  for (unsigned int i = 0; i < starships.size(); i++)
164  starships[i]->Update();
165 }

Member Data Documentation

Camera Briefing::cam
vector< Ship* > Briefing::starships
TextPlane Briefing::tp

Definition at line 50 of file briefing.h.

Referenced by Briefing(), and Mission::BriefingRender().


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