forked from jal278/novelty-search-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaze.cpp
68 lines (65 loc) · 1.17 KB
/
maze.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
#include <vector>
#include <fstream>
#include <iostream>
using namespace std;
class Point
{
public:
void fromfile(ifstream& file)
{
file >> x;
file >> y;
}
int x;
int y;
};
class Line
{
public:
Line(ifstream& file)
{
a.fromfile(file);
b.fromfile(file);
}
Line()
{
}
Point a;
Point b;
};
class Character
{
public:
Character()
{
heading=0.0f;
speed=0.0f;
ang_vel=0.0f;
}
Point location;
float heading;
float speed;
float ang_vel;
};
class Environment
{
public:
Environment(const char* filename)
{
ifstream inpfile(filename);
hero.location.fromfile(inpfile);
end.fromfile(inpfile);
while(!inpfile.eof())
{
Line* x=new Line(inpfile);
lines.push_back(x);
}
}
~Environment()
{
//clean up lines!
}
vector<Line*> lines;
Character hero;
Point end;
};