-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisk.h
65 lines (53 loc) · 1.07 KB
/
disk.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include "gl.h"
#include "i2.h"
#define WHITE true
#define BLACK false
class Disk{
I2 position;
bool onboard; //既に置いてあるかどうか
bool color; //色
bool putable[2];
public:
void place(bool color){
onboard=true;
putable[0]=putable[1]=false;
this->color=color;
}
void draw(bool turn){
if( onboard ){
if( color )glColor3f(1,1,1);
else glColor3f(0,0,0);
GL::DrawCircle(90+60*position.x,90+60*position.y);
}
if( putable[turn] ){
glColor3f(0,1,0.1);
GL::DrawSquare(60+60*position.x,60+60*position.y);
}
}
bool isPutable(bool color){
return this->putable[color];
}
void setPutable(bool color,bool state){
putable[color]=state;
}
bool isOnboard(){
return this->onboard;
}
void setOnboard(bool onboard){
this->onboard=onboard;
}
bool getColor(){
return this->color;
}
void setColor(bool color){
this->color=color;
}
void init_postion(int x, int y){
this->position.x=x;
this->position.y=y;
}
Disk(){
onboard=false;
}
};