-
Notifications
You must be signed in to change notification settings - Fork 0
/
EscenarioAbrible.h
57 lines (52 loc) · 1.31 KB
/
EscenarioAbrible.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
!
! EscenarioAbrible.h
!
! Crea objetos que son parte del escenario pero se pueden abrir y
! cerrar y sólo se describen cuando están abiertos.
!
System_file;
class EscenarioAbrible
with
when_open [;
MostrarNombreLink(self, 1);
print " está abiert", (o) self, ".^"; rtrue; ],
when_closed [;
MostrarNombreLink(self, 1);
print " está cerrad", (o) self, ".^"; rtrue; ],
! Cuando está abierto, pasa de ser escenario a ser estático. Esto se hace
! para que se muestre cuando está abierto, usando la propiedad when_open.
! En realidad, la propiedad when_closed no se usa, porque cuando está
! cerrado es un escenario, y por tanto no se describe:
describe [;
new_line;
if (self has open) PrintOrRun(self, when_open);
else PrintOrRun(self, when_closed);
rtrue;
],
abrir [;
give self open;
give self ~scenery;
give self static;
self.gancho_abrir();
],
cerrar [;
give self ~open;
give self scenery;
give self ~static;
self.gancho_cerrar();
],
gancho_abrir [;
self.gancho();
],
gancho_cerrar [;
self.gancho();
],
gancho [; rfalse; ],
after [;
Open:
self.abrir();
Close:
self.cerrar();
],
has
scenery openable;