WIP.
diff --git a/examples/pizzeria.html b/examples/pizzeria.html
index 52fbd0f..50e8727 100644
--- a/examples/pizzeria.html
+++ b/examples/pizzeria.html
@@ -214,35 +214,35 @@
def isValid: Boolean = !isEmpty && findPizzaWithoutSize.isEmpty
def add(ps: Seq[Pizza], ds: Seq[Drink]): Unit =
- def setByName[T <: OrderPosition](buf: mutable.ArrayBuffer[T], t: T): Unit =
+ def setByName[T <: OrderPosition](buf: mutable.ArrayBuffer[T], t: T): Unit =
buf.find(_.name == t.name) match
- case Some(foundT) => if t.qty.nonEmpty then foundT.qty = t.qty
- case None => buf += t
+ case Some(foundT) => if t.qty.nonEmpty then foundT.qty = t.qty
+ case None => buf += t
- for (p <- ps)
- def setPizza(pred: Pizza => Boolean, notFound: => () => Unit): Unit =
+ for (p <- ps)
+ def setPizza(pred: Pizza => Boolean, notFound: => () => Unit): Unit =
pizzas.find(pred) match
- case Some(foundPizza) =>
+ case Some(foundPizza) =>
if p.size.nonEmpty then foundPizza.size = p.size
if p.qty.nonEmpty then foundPizza.qty = p.qty
- case None => notFound()
+ case None => notFound()
if p.size.nonEmpty then setPizza(
- x => x.name == p.name && x.size == p.size,
- () => setPizza(x => x.name == p.name && x.size.isEmpty, () => pizzas += p)
+ x => x.name == p.name && x.size == p.size,
+ () => setPizza(x => x.name == p.name && x.size.isEmpty, () => pizzas += p)
)
else setByName(pizzas, p)
- for (d <- ds) setByName(drinks, d)
+ for (d <- ds) setByName(drinks, d)
def findPizzaWithoutSize: Option[Pizza] = pizzas.find(_.size.isEmpty)
def fixPizzaWithoutSize(size: String): Boolean =
findPizzaWithoutSize match
- case Some(p) =>
+ case Some(p) =>
p.size = size.?
true
- case None => false
+ case None => false
def getState: PizzeriaOrderState = state