Skip to content

Commit

Permalink
comentado
Browse files Browse the repository at this point in the history
  • Loading branch information
FeliQI committed Nov 27, 2024
1 parent 0cb0d87 commit cb5fa96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 0 additions & 5 deletions adminClientes.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ object adminCliente {
}

method retirarCliente(cliente) {
game.removeTickEvent(cliente)
game.schedule(500, {self.eliminar(cliente)})
}

method eliminar(cliente) {
ubicacion.quitarCliente(cliente)
game.removeVisual(cliente)
game.schedule(1500, {self.crearCliente()})
Expand Down
14 changes: 10 additions & 4 deletions clientes.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,23 @@ class Cliente inherits Persona(position = game.at(88,20)){

method esperarPedido() {
game.schedule(nivelDePaciencia, {self.irseSinNada()})
//El nivel de paciencia es el tiempo que espera el cliente antes de irse sin nada, este schedule
// se encarga de ejecutar irseSinNada una vez que se le termina la paciencia al cliente
}

method irseSinNada() {
self.reaccionMala()
game.removeTickEvent(self)

}

method recibirPedido(pizza){
game.removeTickEvent(self)

manos = pizza
game.removeVisual(manos)
self.ocultarIngredientesDisponibles()
game.schedule(1000, {self.reaccionarAPedido()})
//Espera un segundo antes de hacer al cliente que reaccione al pedido,
// para que la reaccion no sea tan instantanea y se vea mejor
}

method ocultarIngredientesDisponibles() {
Expand Down Expand Up @@ -101,9 +105,10 @@ class Cliente inherits Persona(position = game.at(88,20)){
}

method reaccionBuena() {
game.removeTickEvent(self)

self.pagarPedido()
game.schedule(1000, {adminCliente.retirarCliente(self)})
//Schedule para que no ocurra de manera tan instantanea y el cliente reaccione y un segundo despues se vaya
}

method reaccionMala()
Expand Down Expand Up @@ -145,6 +150,7 @@ class ClienteNormal inherits Cliente(nivelDePaciencia = 90000, image = "cliente_
override method irseSinNada() {
super()
game.schedule(1000, {adminCliente.retirarCliente(self)})
//Para darle tiepo al cliente a reaccionar
}
}

Expand All @@ -163,10 +169,10 @@ class ClienteQuisquilloso inherits Cliente(nivelDePaciencia = 90000, image = "cl
}

override method reaccionMala(){
game.removeTickEvent(self)
emocion = enojado
self.robar()
game.schedule(1000, {adminCliente.retirarCliente(self)})
//Para darle tiepo al cliente a reaccionar
}

method robar(){
Expand Down
2 changes: 1 addition & 1 deletion clientesTest.wtest
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe "adminClientes" {

assert.equals([nuevoCliente], game.getObjectsIn(restaurantest.mostrador()))

adminCliente.eliminar(nuevoCliente)
adminCliente.retirarCliente(nuevoCliente)

assert.equals([], game.getObjectsIn(restaurantest.mostrador()))
}
Expand Down

0 comments on commit cb5fa96

Please sign in to comment.