-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameRhythmState.cpp
More file actions
46 lines (41 loc) · 1.18 KB
/
GameRhythmState.cpp
File metadata and controls
46 lines (41 loc) · 1.18 KB
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
#include "GameRhythmState.h"
bool gameRhythmStateIsSlide(const GameRhythmState& gameRhythmState) {
return gameRhythmState == GR_SLIDE1 || gameRhythmState == GR_SLIDE2;
}
bool gameRhythmStateEqualsColor(const GameRhythmState& gameRhythmState, PieceColor color) {
switch (gameRhythmState) {
case GR_BLUE:
return color == BLUE;
case GR_RED:
return color == RED;
case GR_GREY:
return color == GREY;
default:
return false;
}
}
GameRhythmState& operator++(GameRhythmState& gameRhythmState) {
switch (gameRhythmState) {
case GR_BLUE:
gameRhythmState = GR_RED;
break;
case GR_RED:
gameRhythmState = GR_GREY;
break;
case GR_GREY:
gameRhythmState = GR_SLIDE1;
break;
case GR_SLIDE1:
gameRhythmState = GR_SLIDE2;
break;
case GR_SLIDE2:
gameRhythmState = GR_BLUE;
break;
}
return gameRhythmState;
}
GameRhythmState operator++(GameRhythmState& gameRhythmState, int) {
GameRhythmState tmp(gameRhythmState);
++gameRhythmState;
return tmp;
}