-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcamino.cpp
More file actions
62 lines (55 loc) · 794 Bytes
/
camino.cpp
File metadata and controls
62 lines (55 loc) · 794 Bytes
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
#include "camino.h"
Camino::Camino(Laberinto * l,int x, int y):Posicion(l,x,y)
{
_estado=LIBRE;
_xInicial=18;
_yInicial=88;
_pc=NULL;
}
Camino::~Camino()
{
if(_pc)delete _pc;
}
char Camino::getTipo()
{
return 'C';
}
bool Camino::esValida()
{
if(_estado==LIBRE)
{
return true;
}
else
{
return false;
}
}
int Camino::getEstado()
{
return _estado;
}
void Camino::cambiarEstado(estado nuevoEstado)
{
_estado=nuevoEstado;
}
void Camino::dibujar()
{
_pc=new Circulo(
_xInicial+(LADO*getx()),
_yInicial+(LADO*gety()),
RADIO
);
if(_estado==VISITADO)
{
setcolor(GREEN);
setfillstyle(1, GREEN);
_pc->dibujar();
}
if(_estado==DESCARTADO)
{
setcolor(RED);
setfillstyle(1, RED);
_pc->dibujar();
}
}