Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Game Class Reference

Creates an Game object that inherits State and runs the Game. More...

#include <Game.h>

Inheritance diagram for Game:
Inheritance graph
Collaboration diagram for Game:
Collaboration graph

Public Member Functions

 Game (JAM_StateManager *stateManager, SDL_Renderer *renderer, int screenWidth, int screenHeight)
 
 ~Game ()
 
bool input ()
 
void update (float dt)
 
void draw ()
 
- Public Member Functions inherited from JAM_State
 JAM_State (JAM_StateManager *stateManager, SDL_Renderer *renderer, int screenWidth, int screenHeight)
 
virtual ~JAM_State ()
 

Private Member Functions

bool windowsInput (SDL_Event &incomingEvent)
 
bool androidInput (SDL_Event &incomingEvent)
 

Private Attributes

std::vector< std::vector
< MapSquare * > > 
mapSquares
 
JAM_Audiomusic
 
JAM_Vec2 mouse
 
JAM_Vec2 target
 
int squareScale
 
JAM_Textureborder
 
JAM_TexturetargetTexture
 
JAM_Texturewall
 
JAM_Buttontoggle
 
int placementType
 
JAM_AStaraStar
 
Robotrobot
 

Additional Inherited Members

- Protected Attributes inherited from JAM_State
JAM_StateManagerstateManager
 
SDL_Renderer * renderer
 
int screenWidth
 
int screenHeight
 

Detailed Description

Creates an Game object that inherits State and runs the Game.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

Game::Game ( JAM_StateManager stateManager,
SDL_Renderer *  renderer,
int  screenWidth,
int  screenHeight 
)

Constructs the Game object.

Parameters
stateManagerA pointer to the StateManager.
rendererA pointer to the renderer.
screenWidthThe screen width.
screenHeightThe screen height.

Here is the call graph for this function:

Game::~Game ( )

Destructs the Game object.

Here is the call graph for this function:

Member Function Documentation

bool Game::androidInput ( SDL_Event &  incomingEvent)
private

Handles the Android Game input.

Parameters
incomingEventA reference to the incoming SDL event.
Returns
If false then quit the Game State.

Here is the caller graph for this function:

void Game::draw ( )
virtual

A function to draw to the screen.

Implements JAM_State.

Here is the call graph for this function:

bool Game::input ( )
virtual

Handles the Game input.

Returns
If false then quit the Game State.

Implements JAM_State.

Here is the call graph for this function:

void Game::update ( float  dt)
virtual

A function to update the Game to allow the Game to run.

Parameters
dtThe delta time.

Implements JAM_State.

Here is the call graph for this function:

bool Game::windowsInput ( SDL_Event &  incomingEvent)
private

Handles the Windows Game input.

Parameters
incomingEventA reference to the incoming SDL event.
Returns
If false then quit the Game State.

Here is the caller graph for this function:

Member Data Documentation

JAM_AStar* Game::aStar
private

The AStar path-finding.

JAM_Texture* Game::border
private

The texture for the border.

std::vector<std::vector<MapSquare*> > Game::mapSquares
private

The 2D array of MapSquare objects.

JAM_Vec2 Game::mouse
private

The mouse position.

JAM_Audio* Game::music
private

A pointer to the background music.

int Game::placementType
private

The type of object to place. (1 = target, -1 = wall)

Robot* Game::robot
private

The AStar Robot.

int Game::squareScale
private

The size of the squares.

JAM_Vec2 Game::target
private

The target index.

JAM_Texture* Game::targetTexture
private

The texture for the target.

JAM_Button* Game::toggle
private

The button to toggle placement.

JAM_Texture* Game::wall
private

The texture for the walls.


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