-
Notifications
You must be signed in to change notification settings - Fork 1
/
instruction.h
40 lines (34 loc) · 1 KB
/
instruction.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
#ifndef INSTRUCTION_H
#define INSTRUCTION_H
#include <map>
#include <string>
/**
* Instruction presents a single action that can be applied to a cube. E.g. turn
* the left face.
*/
class Instruction {
public:
enum Turn {
F, // (clockwise) turn the front face
B, // (clockwise) turn the back face
L, // (clockwise) turn the left face
R, // (clockwise) turn the right face
U, // (clockwise) turn the up face
D, // (clockwise) turn the down face
F_, // (counterclockwise) turn the front face
B_, // (counterclockwise) turn the back face
L_, // (counterclockwise) turn the left face
R_, // (counterclockwise) turn the right face
U_, // (counterclockwise) turn the up face
D_ // (counterclockwise) turn the down face
};
Instruction(Turn turn);
// Gets turn.
const Turn &GetTurn() const;
// Gets string presentation of this instruction.
std::string GetName() const;
private:
static std::map<Turn, std::string> _turn_names;
const Turn _turn;
};
#endif