-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspace.h
More file actions
54 lines (42 loc) · 792 Bytes
/
space.h
File metadata and controls
54 lines (42 loc) · 792 Bytes
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
//
// space.h
// CS2401Project7
//
// Created by Aaron Robeson on 11/19/15.
// Copyright © 2015 Aaron Robeson. All rights reserved.
//
#ifndef space_h
#define space_h
#include <stdio.h>
namespace main_savitch_14 {
class space {
public:
enum color {empty, white, black};
space() {spaceColor = empty;}
color getColor() const {return spaceColor;}
void setColor(color toSet) {
spaceColor = toSet;
}
void flip() {
if (spaceColor == black) {
spaceColor = white;
} else if (spaceColor == white) {
spaceColor = black;
}
}
private:
color spaceColor;
};
}
#endif /* space_h */
/*
void setColor(char toSet) {
if (toSet == 'w') {
spaceColor = white;
} else if (toSet == 'b') {
spaceColor = black;
} else if (toSet == 'e') {
spaceColor = empty;
}
}
*/