Coffee ! case class Cup(contents: Option[Coffee]) ! case class OrderCoffee(cashier: ActorRef) ! implicit val system = ActorSystem("coffee-shop") ! class Customer extends Actor { ! var money = Some(Money()) ! var cup = None ! def receive = { ! ! case OrderCoffee(cashier) => ! ! ! val m = money ! ! ! money = None ! ! ! cashier ! m ! ! case c: Cup => ! ! ! cup = c ! ! ! println("Whooohooo! Coffee :-)") ! } } } Wednesday 2 October 13