Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes

Match Class Reference

Abstract match class. More...

#include <Match.h>

Inheritance diagram for Match:
MultiplayerMatch SinglePlayerMatch

List of all members.

Public Member Functions

 Match ()
virtual ~Match ()
virtual int Update (double deltaTime, CIw2DFont *font)=0
int BaseUpdate (double deltaTime, CIw2DFont *font)
void Draw (double deltaTime)
void ResetGame ()

Protected Types

enum  State {
  PLAYING, TUTORIAL, QUITMENU, RESTARTMENU,
  PAUSEMENU, LOBBY, ENDGAME
}
 

Match states.


enum  Result { REDWIN = 1, YELLOWWIN = 2, DRAW = 3 }
 

Possible match results.


Protected Member Functions

void DrawWaitingText (CIw2DFont *font)

Protected Attributes

CIw2DImage * m_catapultImage
 Image for the catapult.
CIw2DImage * m_pauseButton
 Image for the pause button.
CIw2DImage * m_backButton
 Image for the back button.
CIwFVec2 m_catapultPosition
 Position for the catapult image.
CIwFVec2 m_pauseButtonPosition
 Position for the pause button.
CIwFVec2 m_aiTextPosition
 Position for the ai text.
CIwFVec2 m_aiTextDimensions
 Dimensions for the ai text.
CIwFVec2 m_pauseButtonDimensions
 Dimensions for the pause button.
CIwFVec2 m_catapultDimensions
 Dimensions for the catapult.
CIwFVec2 m_backButtonPosition
 Position for the back button.
CIwFVec2 m_backButtonDimensions
 Dimensions for the back button.
double m_startTime
 Start time of the match.
Tutorialm_tutorial
 Basic tutorial which is displayed at the start of singleplayer matches.
Gridm_grid
 The grid.
PauseMenum_pauseMenu
 The pause menu.
EndMenum_endMenu
 The end game menu.
State m_state
 Current match state.
CIw2DFont * m_aiFont
 Font for rendering ai text.
bool m_aiRender
 Should ai quote be rendered?
bool m_aiPrevRender
 Was an ai quote being rendered last update?
CIwFVec2 m_gridPosition
 Grid position.
CIw2DImage * m_aiQuotes [m_numQuotes]
 Array of ai quote images.
CIwFVec2 m_aiQuotePos
 Position for rendering ai quotes.
CIwFVec2 m_aiQuoteSize
 Size for rendering ai quotes.
int m_quoteIndex
 Index of the quote to be displayed. Will be assigned randomly.
CIw2DFont * m_statusFont
 Font for status outputs.
CIwFVec2 m_searchingTextPos
 Position for the "searching" text.
CIwFVec2 m_ipStatusPos
 Position for ip status text.
CIwFVec2 m_portStatusPos
 Position for port status text.
CIwFVec2 m_serverStatusPos
 Position for server status text.
CIwFVec2 m_textRectangle
 Size of text rendering rectangle.
char * m_ipStatus
 Ip status (has ip been receiveed or not).
char * m_serverStatus
 Status of the server.
char * m_portStatus
 Status of the port.
int m_textCounter
 Counter for animating text.

Static Protected Attributes

static const int m_standardGridSize = 85
 Main game grid tile size.
static const int m_numQuotes = 5
 Number of ai quote images.

Detailed Description

Abstract match class.

Abstract match class for singleplayer and multiplayer matches to inherit from.


Constructor & Destructor Documentation

Match::Match (  ) 

Constructor.

Create a new match.

Match::~Match (  )  [virtual]

Destructor.

Destroy the match.


Member Function Documentation

int Match::BaseUpdate ( double  deltaTime,
CIw2DFont *  font 
)

Base update.

Update the match.

Parameters:
[in] deltaTime Time since last update.
[in] font Font for drawing text.
void Match::Draw ( double  deltaTime  ) 

Draw.

Render the match.

Parameters:
[in] deltaTime Time since the last update.
void Match::DrawWaitingText ( CIw2DFont *  font  )  [protected]

Draw waiting text.

Renders the lobby text for multiplayer games.

Parameters:
[in] font Font for rendering text.
void Match::ResetGame (  ) 

Reset.

Reset the game.

virtual int Match::Update ( double  deltaTime,
CIw2DFont *  font 
) [pure virtual]

Update.

Update the match.

Parameters:
[in] deltaTime Time since last update.
[in] font Font for drawing text.

Implemented in MultiplayerMatch, and SinglePlayerMatch.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations