Skip to content

Commit

Permalink
Update personas.wlk
Browse files Browse the repository at this point in the history
  • Loading branch information
regueiranehuen authored Nov 22, 2024
1 parent 4728bce commit 31818ef
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions personas.wlk
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
import eventos.*
class Persona{
var emociones = []
var edad
var cantEventos = 0

// 1)
method esAdolescente(){
return edad >= 12 || edad < 19
}

method cantEventos()=cantEventos

// 2)
method agregarEmocion(emocion){
emociones.add(emocion)
}


// 3)
method estaPorExplotarEmocionalmente(){
return emociones.all({emocion=>emocion.puedeLiberarse(self)})
}

// 4)
method vivirEvento(evento){
emociones.forEach({emocion => emocion.puedeLiberarse(self)
emocion.liberarse(evento)
emocion.agregarEvento()})
}



}

class Grupo{
var integrantes = []

// 6)
method vivirMismoEvento(evento){
integrantes.forEach({integrante=>integrante.vivirEvento(Evento)})
}
}

0 comments on commit 31818ef

Please sign in to comment.