This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
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>
|
|
|
|
|
|
|
|
#define PX_(p, x, y, w, h) ((p)[(x)+(y)*(w)])
|
|
|
|
#define PX(i,x,y) (PX_((uint32_t*)(i)->pixels, (x), (y), (i)->w, (i)->h))
|
|
|
|
#define iter_pixels(s,x,y) for (x = 0; x < s->w; x++) for (y = 0; y < s->h; y++)
|
2007-02-23 18:10:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the current state of a go board.
|
|
|
|
*/
|
|
|
|
class State
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Standard constructor
|
|
|
|
*/
|
|
|
|
State( void );
|
|
|
|
|
|
|
|
void setSize(int size) { State::size = size; }
|
|
|
|
|
|
|
|
static State generateState( SDL_Surface *board, Settings settings);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int size;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ifndef _STATE_H_ */
|