forked from Zanuro/Pract-IA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoche.hpp
More file actions
81 lines (63 loc) · 1.43 KB
/
Copy pathcoche.hpp
File metadata and controls
81 lines (63 loc) · 1.43 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef COCHE_HPP
#define COCHE_HPP
#include <utility>
#include <set>
#include "point.hpp"
enum class Direction{
north,
south,
west,
east
};
namespace IA {
typedef struct grid Grid;
struct comparate;
using x_coordinate = int;
using y_coordinate = int;
using coordinates = std::pair<x_coordinate,y_coordinate>;
const coordinates movement[] = {coordinates(1,0),coordinates(0,-1),coordinates(-1,0),coordinates(0,1)};
class car{
protected:
/*Direction direction;
coordinates position;*/
private:
int x_coordinate;
int y_coordinate;
int number_clients;
public:
car(void):
x_coordinate(0),
y_coordinate(0),
number_clients(0){}
car(int primera,int segunda):
x_coordinate(primera),
y_coordinate(segunda),
number_clients(0){}
virtual ~car() = default;
const int get_x(void) const {return x_coordinate;}
const int get_y(void) const {return y_coordinate;}
const int get_number_of_clients(void) const {return number_clients;}
void set_x(int x){
x_coordinate=x;
}
void set_y(int y){
y_coordinate=y;
}
void set_number_clients(int clients){
number_clients = clients;
}
void move_up(){
set_y(get_y()+1);
}
void move_down(){
set_y(get_y()-1);
}
void move_left(){
set_x(get_x()-1);
}
void move_right(){
set_x(get_x()+1);
}
};
}
#endif // COCHE_HPP