-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ca06df
commit 4cbd022
Showing
1 changed file
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,64 @@ | ||
class Persona{ | ||
cclass Persona{ | ||
var edad | ||
var emociones = [] | ||
var intensidadElevada = 300 | ||
// VER LO DEL EVENTO | ||
|
||
method esAdolescente() = (edad > 12) && (edad < 19) | ||
|
||
method nuevaEmocion(emocion){ | ||
emociones.add(emocion) | ||
} | ||
|
||
method puedeExplotarEmocionalmente() = emociones.all({emocion => emocion.puedeLiberarse()}) | ||
|
||
method modificarIntensidadElevada(nuevaIntensidad){ | ||
intensidadElevada = nuevaIntensidad | ||
} | ||
} | ||
|
||
class Evento{ | ||
var impacto | ||
const descripcion = [] | ||
} | ||
|
||
class Emocion{ | ||
var cantidadEventos | ||
var property intensidad | ||
var property intensidad | ||
|
||
method liberarse(evento){ | ||
intensidad -= evento.impacto() | ||
} | ||
|
||
method puedeLiberarse(persona) = (persona.intensidadElevada() <= intensidad) | ||
} | ||
|
||
class Furia inherits Emocion{ | ||
var palabrotas = [] | ||
|
||
override method intensidad() = 100 | ||
|
||
method nuevaPalabrota(palabrota){ | ||
palabrotas.add(palabrota) | ||
} | ||
|
||
method olvidarPalabrota(palabrota){ | ||
palabrotas.remove(palabrota) | ||
} | ||
|
||
override method puedeLiberarse(persona) = super(persona) && palabrotas.any{palabrota => palabrota.size() > 7} | ||
|
||
override method liberarse(evento){ | ||
super(evento) | ||
self.olvidarPalabrota(palabrotas.first()) | ||
} | ||
} | ||
|
||
class Alegria inherits Emocion{ | ||
|
||
override method puedeLiberarse(persona) = super(persona) && cantidadEventos.even() | ||
} | ||
|
||
class Tristeza inherits Emocion{ | ||
|
||
} |