-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGCube.cpp
88 lines (58 loc) · 1.22 KB
/
GCube.cpp
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Derekas Panagiwths 4014
* Thoma Athanasios 2979
*/
#include "GCube.h"
GCube::GCube() {
value = BLANK;
// both of these will be set by the manager,
//just set to 0 so compiler doesn't complain
x = 0;
y = 0;
}
void drawCube(int val){
switch(val){
case BLANK:
//color to beige
glColor4f(0.96f,0.84f,0.59f,1.0f);
glutSolidCube(CUBE_SIZE);
break;
case ROCK:
glColor4f(1.0f,1.0f,1.0f,1.0f);
TextureLoader::drawTiltedSquare(ROCK);
glutWireCube(CUBE_SIZE);
break;
case PAPER:
glColor4f(1.0f,1.0f,1.0f,1.0f);
TextureLoader::drawTiltedSquare(PAPER);
glutWireCube(CUBE_SIZE);
break;
case SCISSORS:
glColor4f(1.0f,1.0f,1.0f,1.0f);
TextureLoader::drawTiltedSquare(SCISSORS);
glutWireCube(CUBE_SIZE);
break;
case BLUE:
glColor4f(0.0f,0.0f,0.85f,1.0f);
glutSolidCube(CUBE_SIZE);
break;
case RED:
glColor4f(0.85f,0.0f,0.0f,1.0f);
glutSolidCube(CUBE_SIZE);
break;
case BOMB:
glColor4f(1.0f,1.0f,0.0f,1.0f);
TextureLoader::drawTiltedSquare(BOMB);
glutWireCube(CUBE_SIZE);
}
}
void GCube::setValue(int val){
value = val;
drawCube(value);
}
void GCube::showUpdatedCubeValue(){
drawCube(value);
}
int GCube::getValue(){
return value;
}