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

GridSquare Class Reference

Grid square. More...

#include <GridSquare.h>

List of all members.

Public Types

enum  State { RED, YELLOW, EMPTY }
 

State of the square.


Public Member Functions

 GridSquare (CIwFVec2 position, int tileSize)
 ~GridSquare ()
void Draw ()
void SetState (State newState)
State GetState ()

Protected Attributes

CIwFVec2 m_position
 Position of the square.
CIwFVec2 m_offsetPosition
 Offset position of the square for rendering.
CIwFVec2 m_size
 Size of a tile.
State m_state
 State of the square.

Static Protected Attributes

static CIw2DImage * m_emptyTexture
 Texture for empty square.
static CIw2DImage * m_redTexture
 Texture for red squares.
static CIw2DImage * m_yellowTexture
 Texture for yellow squares.

Detailed Description

Grid square.

A square in the grid column.


Constructor & Destructor Documentation

GridSquare::GridSquare ( CIwFVec2  position,
int  tileSize 
)

Constructor.

Create a new grid square.

Parameters:
[in] position Position of the square (top left corner).
[in] tileSize Size of a grid tile.
GridSquare::~GridSquare (  ) 

Destructor.

Delete the square and release all associated memory.


Member Function Documentation

void GridSquare::Draw (  ) 

Draw.

Render the grid square.

GridSquare::State GridSquare::GetState (  ) 

Get state.

Get the state of this square.

Returns:
State colour of this square.
void GridSquare::SetState ( State  newState  ) 

Set the state.

Set the colour of the square (red, yellow, empty).


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