2007-02-23 18:10:32 +01:00
|
|
|
#ifndef _STATE_H_
|
|
|
|
#define _STATE_H_
|
|
|
|
|
|
|
|
#include "settings.h"
|
|
|
|
#include <SDL/SDL.h>
|
2007-02-23 18:41:14 +01:00
|
|
|
#include <stdint.h>
|
2007-02-26 11:45:05 +01:00
|
|
|
#include "image.h"
|
2007-02-23 18:10:32 +01:00
|
|
|
|
2007-02-23 20:14:48 +01:00
|
|
|
|
2007-02-23 18:10:32 +01:00
|
|
|
/**
|
|
|
|
* Describes the current state of a go board.
|
|
|
|
*/
|
|
|
|
class State
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Standard constructor
|
|
|
|
*/
|
|
|
|
State( void );
|
2007-02-23 23:28:29 +01:00
|
|
|
virtual ~State( void );
|
2007-02-23 18:10:32 +01:00
|
|
|
|
|
|
|
void setSize(int size) { State::size = size; }
|
2007-02-23 23:28:29 +01:00
|
|
|
void printState( void );
|
2007-02-23 18:10:32 +01:00
|
|
|
|
|
|
|
static State generateState( SDL_Surface *board, Settings settings);
|
|
|
|
|
2007-02-23 20:14:48 +01:00
|
|
|
/*
|
|
|
|
* Get the image point corresponding to board position (i, j) using
|
|
|
|
* settings s.
|
|
|
|
*/
|
|
|
|
static point positionPoint(int i, int j, Settings s);
|
|
|
|
|
2007-02-23 23:28:29 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The size of the board, e.g. 19x19, 13x13 etc.
|
|
|
|
*/
|
2007-02-23 18:10:32 +01:00
|
|
|
static int size;
|
2007-02-23 23:28:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* array describing the board situation
|
|
|
|
*/
|
|
|
|
type *board;
|
2007-02-23 18:10:32 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ifndef _STATE_H_ */
|