Main Page | Class Hierarchy | Class List | File List | Class Members

Grid Class Reference

Class for board visualisation. More...

#include <grid.h>

List of all members.

Public Member Functions

 Grid ()
 Standard constructor.

void set (int x, int y, char pl)
 Sets board data of grid.

char get (int x, int y)
 Returns board data at position x,y.

void draw ()
 Draws grid on screen.

bool can_player_move (int pl_no)
 Tests if player can move.

bool isLegalMove (int px, int py, int plNo)
 Checks if player's move at x,y is legal.

void printf (const char *fmt,...)
 Sets up message.


Public Attributes

int map [boardSize]
 The board data of grid.


Protected Attributes

int gfx_x
 The x screen offset of grid.

int gfx_y
 The y screen offset of grid.

int field_width
 The grid field width.

string msg
 The message string to be displayed.


Detailed Description

Class for board visualisation.

This class is used to draw board on screen.


Member Function Documentation

bool Grid::can_player_move int  pl_no  ) 
 

Tests if player can move.

Parameters:
pl_no The number of player to test.
Returns:
True if player can move, else otherwise.

Here is the call graph for this function:

char Grid::get int  x,
int  y
 

Returns board data at position x,y.

Parameters:
x The x field position.
y The y field position.
Returns:
The value of grid at x,y position.

Here is the call graph for this function:

bool Grid::isLegalMove int  px,
int  py,
int  plNo
 

Checks if player's move at x,y is legal.

Parameters:
px The player move x coordinate.
py The player move y coordinate.
plNo The nubmer of player.
Returns:
Legallity of player move.

Here is the call graph for this function:

void Grid::printf const char *  fmt,
  ...
 

Sets up message.

This method sets message string. It's simillar like C printf function.

Parameters:
fmt The formating string.

Here is the call graph for this function:

void Grid::set int  x,
int  y,
char  pl
 

Sets board data of grid.

Parameters:
x The x field position of move.
y The y field position of move.
pl The value of field.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri May 14 02:44:26 2004 for Reversi by doxygen 1.3.7