-
Notifications
You must be signed in to change notification settings - Fork 0
/
Turmite.h
61 lines (44 loc) · 1.11 KB
/
Turmite.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
#pragma once
#include "StateTransitionTable.h"
// Forward declaration on world
class World;
// Current orientation of the Turmite
enum eOrientation
{
eNorth = 0,
eEast,
eSouth,
eWest,
eOrientation_Max
};
class Turmite
{
public:
Turmite( const int inPosX,
const int inPosY,
const State inState,
const eOrientation inOrientation,
World* inWorld,
StateTransitionTable* inStateTransitionTable );
~Turmite(void);
unsigned int Step();
void GetPosistion( int& outX, int& outY ) const { outX = m_posX; outY = m_posY; }
private:
// Rotate using the
void Rotate( const eMovement inMovement );
// Turmite position, state and orientation
int m_posX;
int m_posY;
State m_state;
eOrientation m_orientation;
// State transition table with the rules
StateTransitionTable* m_stateTransitionTable;
// Number of iterations done
unsigned int m_currentStep;
// Every step investigate the world
World* m_world;
// private default constructor/copy constructor/assignment operator
Turmite();
Turmite( const Turmite& );
const Turmite& operator=( const Turmite& );
};