MainGameState Class Reference

#include <MainGameState.h>

Inherits GameState.

Inheritance diagram for MainGameState:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 10 of file MainGameState.h.

Public Member Functions

spUnit createUnit (int playerID, int x, int y)
virtual void deinit ()
void endActiveUnitTurn ()
void focusOnUnit (spUnit u)
spUnit getActiveUnit ()
spUnit getSelectedUnit ()
virtual void init ()
bool loadMap (string fileName)
 MainGameState (Application *app)
void processSDLEvent (SDL_Event &event)
void selectUnit (spUnit u)
virtual void update (unsigned int deltaTime)
virtual ~MainGameState ()

Private Attributes

Camera _camera
spMap _map
vector< Player_players
spUnit _selectedUnit
list< spUnit_unitQueue


Constructor & Destructor Documentation

MainGameState::MainGameState ( Application app  ) 

Definition at line 8 of file MainGameState.cpp.

MainGameState::~MainGameState (  )  [virtual]

Definition at line 16 of file MainGameState.cpp.


Member Function Documentation

spUnit MainGameState::createUnit ( int  playerID,
int  x,
int  y 
)

Definition at line 90 of file MainGameState.cpp.

References _map, _players, _unitQueue, getActiveUnit(), and Unit::makeUnit().

Referenced by init(), and processSDLEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainGameState::deinit (  )  [virtual]

Implements GameState.

Definition at line 22 of file MainGameState.cpp.

void MainGameState::endActiveUnitTurn (  ) 

Definition at line 202 of file MainGameState.cpp.

References _unitQueue, focusOnUnit(), getActiveUnit(), Unit::hasTurnBefore(), and Unit::regenActionPoints().

Referenced by processSDLEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainGameState::focusOnUnit ( spUnit  u  ) 

Definition at line 242 of file MainGameState.cpp.

References _camera, _map, Camera::getPosition(), Singleton< T >::instance(), and Camera::setPosition().

Referenced by endActiveUnitTurn(), and init().

Here is the call graph for this function:

Here is the caller graph for this function:

spUnit MainGameState::getActiveUnit (  ) 

Definition at line 112 of file MainGameState.cpp.

References _unitQueue.

Referenced by createUnit(), endActiveUnitTurn(), processSDLEvent(), selectUnit(), and update().

Here is the caller graph for this function:

spUnit MainGameState::getSelectedUnit (  ) 

void MainGameState::init (  )  [virtual]

Implements GameState.

Definition at line 27 of file MainGameState.cpp.

References _camera, _map, _players, createUnit(), focusOnUnit(), MapTile::getHeight(), MapTile::getWidth(), loadMap(), and Camera::setBorders().

Here is the call graph for this function:

bool MainGameState::loadMap ( string  fileName  ) 

Definition at line 84 of file MainGameState.cpp.

References _map.

Referenced by init().

Here is the caller graph for this function:

void MainGameState::processSDLEvent ( SDL_Event &  event  )  [virtual]

Implements GameState.

Definition at line 118 of file MainGameState.cpp.

References _camera, _map, createUnit(), Direction::E, endActiveUnitTurn(), getActiveUnit(), Camera::getPosition(), Unit::getSelectedUnit(), Direction::N, Direction::NE, Direction::NW, Direction::S, Direction::SE, selectUnit(), Direction::SW, and Direction::W.

Here is the call graph for this function:

void MainGameState::selectUnit ( spUnit  u  ) 

Definition at line 224 of file MainGameState.cpp.

References _unitQueue, and getActiveUnit().

Referenced by processSDLEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainGameState::update ( unsigned int  deltaTime  )  [virtual]

Implements GameState.

Definition at line 45 of file MainGameState.cpp.

References _camera, _map, getActiveUnit(), Camera::getPosition(), Unit::getSelectedUnit(), Singleton< T >::instance(), Camera::update(), Point::x, and Point::y.

Here is the call graph for this function:


Member Data Documentation

Camera MainGameState::_camera [private]

Definition at line 36 of file MainGameState.h.

Referenced by focusOnUnit(), init(), processSDLEvent(), and update().

spMap MainGameState::_map [private]

Definition at line 32 of file MainGameState.h.

Referenced by createUnit(), focusOnUnit(), init(), loadMap(), processSDLEvent(), and update().

vector<Player> MainGameState::_players [private]

Definition at line 33 of file MainGameState.h.

Referenced by createUnit(), and init().

spUnit MainGameState::_selectedUnit [private]

Definition at line 35 of file MainGameState.h.

list<spUnit> MainGameState::_unitQueue [private]

Definition at line 34 of file MainGameState.h.

Referenced by createUnit(), endActiveUnitTurn(), getActiveUnit(), and selectUnit().


The documentation for this class was generated from the following files:
Generated on Fri Sep 22 06:00:27 2006 for X-CLONE by  doxygen 1.4.7