-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.ts
112 lines (101 loc) · 2.07 KB
/
script.ts
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
abstract class Combo {
protected description: string;
getDescription(): string {
return this.description;
}
abstract Costo() :number;
}
class ComboHutCheese extends Combo {
constructor() {
super();
this.description = 'Combo Hut Cheese';
}
Costo(): number {
return 42.00;
}
}
class PackFamiliar extends Combo {
constructor() {
super();
this.description = 'Pack Familiar';
}
Costo(): number {
return 28.00;
}
}
class HutComboMediano extends Combo {
constructor() {
super();
this.description = 'Hut Combo Mediano';
}
Costo(): number{
return 34.00;
}
}
class HutPackFamiliar extends Combo {
constructor() {
super();
this.description = 'Hut Pack Familiar';
}
Costo(): number{
return 55.00;
}
}
abstract class addDecorador extends Combo {
abstract getDescription(): string;
}
class SalsaMediterranea extends addDecorador {
combo: Combo;
constructor(combo: Combo) {
super();
this.combo = combo;
}
getDescription(): string {
return this.combo.getDescription() + ", Salsa Mediterranea ";
}
Costo() :number {
return 3.00 + this.combo.Costo();
}
}
class CocaCola extends addDecorador {
combo: Combo;
constructor(combo: Combo) {
super();
this.combo = combo;
}
getDescription(): string {
return this.combo.getDescription() + ", Coca Cola 1.5Lt ";
}
Costo(): number {
return 10 + this.combo.Costo();
}
}
class IncaKola extends addDecorador {
combo: Combo;
constructor(combo: Combo) {
super();
this.combo = combo;
}
getDescription(): string {
return this.combo.getDescription() + ", Inca Kola 1.5Lt ";
}
Costo(): number {
return 10 + this.combo.Costo();
}
}
class VolcanDeChocalate extends addDecorador {
combo: Combo;
constructor(combo: Combo) {
super();
this.combo = combo;
}
getDescription(): string {
return this.combo.getDescription() + ", Volcan de Chocolate ";
}
Costo(): number {
return 6 + this.combo.Costo();
}
}
let products: Array<Combo> = [];
let ventas: Array<Combo[]> = [];
let combos: Combo;