Skip to content

Commit

Permalink
tests y cambios varios
Browse files Browse the repository at this point in the history
  • Loading branch information
FeliQI committed Nov 27, 2024
1 parent c75215c commit 2d737fd
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 32 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TECLAS:
- ←/↑/→/↓ : moverse
- Q : interactuar con los objetos
- W : procesar ingredientes
- E : preguntar pedido
- R : cambiar modo de correr a caminar/ caminar a correr


Expand Down
5 changes: 1 addition & 4 deletions adminClientes.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import mapaObjetos.*

import wollok.game.*

//se necesitan comentarios sobre los onTick y Schedules, no los entiendo

object adminCliente {
const factories = #{factoryNormal, factoryPaciente, factoryQuisquilloso}
var hayCliente = false
Expand All @@ -17,11 +15,10 @@ object adminCliente {

method crearCliente() {
const nuevoCliente = self.clienteRandom()

ubicacion.clientes().add(nuevoCliente)
game.addVisual(nuevoCliente)

nuevoCliente.hacerPedido()

}

method retirarCliente(cliente) {
Expand Down
Binary file added assets/cartel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion chefs.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Chef inherits Persona {
}

method soltar(){
bandeja = bandejaVacia //la bandeja representa el no tener nada
bandeja = bandejaVacia
}

method recibir(ingrediente) {
Expand All @@ -41,5 +41,9 @@ class Chef inherits Persona {

mueble.procesarIngredientes()
}

method preguntarPedido() {
ubicacion.clienteActual().anunciarPedido()
}

}
16 changes: 3 additions & 13 deletions clientes.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import adminClientes.*

import wollok.game.*

//se necesitan comentarios sobre los onTick y Schedules, no los entiendo


class Cliente inherits Persona(position = game.at(88,20)){
var pedidoQueEspero = []
Expand Down Expand Up @@ -38,18 +36,10 @@ class Cliente inherits Persona(position = game.at(88,20)){
}

method anunciarPedido() {
//game.say(self, self.pedidoAString())
self.text()
game.say(self, self.pedidoAString())
//self.text()
}

method text(){
return self.pedidoAString()
}

method textColor(){
return "#000000"
}

method pedidoAString() {
return "Quiero una pizza con " + self.pedidoQueEspero().join(", ") + ", por favor!"
}
Expand Down Expand Up @@ -145,7 +135,7 @@ class ClienteNormal inherits Cliente(nivelDePaciencia = 90000, image = "cliente_
}

method valorTip(){
return 0.randomUpTo(disponibilidadParaTip)
return 5.randomUpTo(disponibilidadParaTip)
}

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

nuevoCliente.reaccionBuena()

assert.that(caja.plata() >= 920)
assert.that(caja.plata() >= 905)
assert.equals(feliz, nuevoCliente.emocion())

}
Expand Down
8 changes: 7 additions & 1 deletion mapa.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object teclas{
keyboard.right().onPressDo({remy.mover(derecha)})
keyboard.left().onPressDo({remy.mover(izquierda)})
keyboard.r().onPressDo({remy.cambiarModo()}) //correr/caminar
keyboard.p().onPressDo({remy.decirPosicion()})
keyboard.e().onPressDo({remy.preguntarPedido()})
}

//LAS INTERACCIONES SI ANDAN SOLO QUE UNICO DETALLITO QUE SE PODRÍA CAMBIAR DESPUÉS SI PUEDO ES QUE EL MUEBLE SE TRABAJE CON UN AREA MÁS QUE CON UNA POSICION ESPECIICA PORQUE TENES QUE DARLE CLICK EN UN LUGAR MEDIO ESPECIFICO A LOS OBJETOS PARA INTERACTUAR
Expand Down Expand Up @@ -87,6 +87,12 @@ object imagenes {
game.addVisual(sep10)
game.addVisual(deco1)
game.addVisual(deco2)
/*game.addVisual(cartel1)
game.addVisual(cartel2)
game.addVisual(texto1)
game.addVisual(texto2)
game.addVisual(texto3)
game.addVisual(texto4)*/
}

}
Expand Down
33 changes: 32 additions & 1 deletion mapaObjetos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,35 @@ const sep10 = new MuebleSeparador(position = game.at(6,25))

//decoracion:
const deco1 = new MesaDeco(position = game.at(22,12))
const deco2 = new MesaDeco(position = game.at(49,12))
const deco2 = new MesaDeco(position = game.at(49,12))

/*Interfaz
const cartel1 = new Cartel(position = game.at(0,0))
const cartel2 = new Cartel(position = game.at(0,6))
const texto1 = new Text(position = game.at(7,2), textoAMostrar = caja.plata().toString() + "$")
const texto2 = new Text(position = game.at(7,8), textoAMostrar = caja.objetivo().toString() + "$")
const texto3 = new Text(position = game.at(3,11), textoAMostrar = "Objetivo:")
const texto4 = new Text(position = game.at(6,5), textoAMostrar = "Total Acumulado:")
class Cartel {
const property position = null
const property image = "cartel.png"
}
class Text {
const objetoFuente = caja
const property position = null
var textoAMostrar = null //caja.plata().toString() + "$"
method text() {
return textoAMostrar
}
method textColor(){
return "FF000FFF"
}
}
//class TextObjetivo inherits Text() {}*/
3 changes: 2 additions & 1 deletion objetosRecepcion.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import personaBase.*
object caja {
const property image = "caja.png"
const property position = game.at(76, 25)
var property objetivo = 5000

var plata = 0

Expand Down Expand Up @@ -58,7 +59,7 @@ class Mostrador inherits MuebleParaCocinar(image = "mueble_entrega.png") {
}

method avisarACliente() {
ubicacion.cliente().recibirPedido(contenido)
ubicacion.clienteActual().recibirPedido(contenido)
contenido = bandejaVacia
}
}
Expand Down
4 changes: 0 additions & 4 deletions personaBase.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ class Persona {
return 5
}

method decirPosicion() {
game.say(self, position.toString())
}

}

object bandejaVacia {
Expand Down
2 changes: 1 addition & 1 deletion restaurante.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Restaurante {
}


method cliente() {
method clienteActual() {
return clientes.head()
}

Expand Down
10 changes: 5 additions & 5 deletions restauranteTest.wtest
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import wollok.game.*
describe "restaurante" {
test "busca objetos que hay y te devuelve el objeto en esa dirección" {
assert.notThat(restaurantest.hayMuebleAqui( game.at(1, 0) ))
assert.equals(horno, restaurantest.muebleAqui( game.at(5, 5) ))
assert.equals(horno, restaurantest.muebleAqui( game.at(4,30) ))

assert.that(restaurantest.hayMuebleAqui( game.at(2, 5) ))
assert.equals(mesada, restaurantest.muebleAqui( game.at(2, 5) ))
assert.that(restaurantest.hayMuebleAqui( game.at(4,27) ))
assert.equals(mesada, restaurantest.muebleAqui( game.at(4,27) ))

assert.that(restaurantest.hayMuebleAqui( game.at(4, 5) ))
assert.equals(mesada2, restaurantest.muebleAqui( game.at(4, 5) ))
assert.that(restaurantest.hayMuebleAqui( game.at(4,29) ))
assert.equals(mesada2, restaurantest.muebleAqui( game.at(4,29) ))
}

test "busca objetos que no hay entonces no da error cuando te devuelve los objetos en esa dirección sino que te devuelve el mueble fantasma" {
Expand Down

0 comments on commit 2d737fd

Please sign in to comment.