-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCell.h
38 lines (32 loc) · 962 Bytes
/
Cell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef CELL_H
#define CELL_H
#include <SFML/Graphics.hpp>
#include "SpriteSheet.h"
using namespace sf;
class Cell : public Drawable
{
public:
Cell(int i,int j,float size,Vector2f _offset,int value=0);
enum CellState{Hidden,Revealed,Flagged};
void setValue(int value){this->value=value;}
int getValue(){return value;}
void setState(CellState state){this->state=state;}
CellState getState(){return state;}
void reveal();
bool flag();
void update();
virtual void draw(RenderTarget & target,RenderStates states) const;
protected:
private:
int value;
Vector2i index;
CellState state;
static Texture cellBackground;
static Texture revealedT;
RectangleShape shape;
RectangleShape background;
static std::vector<Texture> numbers;
static bool loaded;
SpriteSheet sprites;
};
#endif // CELL_H