forked from Jorjote/Algoritmos-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tipos.h
30 lines (24 loc) · 792 Bytes
/
Tipos.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
#ifndef AED2_TIPOS_H_
#define AED2_TIPOS_H_
#include "Modulos Basicos/aed2/TiposBasicos.h"
namespace aed2{
struct Posicion
{
Posicion(Nat coordX, Nat coordY):x(coordX),y(coordY){}
Posicion(){x=0;y=0;}; // constructor por defecto de Posicion.
Nat x;
Nat y;
Nat X()const{Nat res=0;res=this->x;return res;}
Nat Y()const{Nat res=0;res=this->y;return res;}
bool operator == (Posicion p)const {return (this->X()==p.X()) && (this->Y()==p.Y());}
std::ostream& mostrar(std::ostream& os)
{
os << "(" << x << "," << y << ")";
return os;
}
};
typedef enum {izq,der,arriba,abajo} Direccion;
typedef Nat Agente;
typedef String Nombre;
} // namespace aed2
#endif // AED2_TIPOS_H_