From b11c02e8f1f4dea09847da999c2acb2f96df8a58 Mon Sep 17 00:00:00 2001 From: Aleksi Heikkila Date: Sat, 23 Nov 2024 21:48:32 +0200 Subject: Inventory, pickup loppuun, drop loppuun --- src/scalevalapokalypsi/Model/Entities/Player.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/scalevalapokalypsi/Model/Entities/Player.scala') diff --git a/src/scalevalapokalypsi/Model/Entities/Player.scala b/src/scalevalapokalypsi/Model/Entities/Player.scala index cac5bf1..1dd5187 100644 --- a/src/scalevalapokalypsi/Model/Entities/Player.scala +++ b/src/scalevalapokalypsi/Model/Entities/Player.scala @@ -1,6 +1,6 @@ package scalevalapokalypsi.Model.Entities -import scala.collection.mutable.Buffer +import scala.collection.mutable.{Buffer, Map} import scalevalapokalypsi.Model.* /** A `Player` object represents a player character controlled by one real-life player @@ -18,6 +18,7 @@ class Player(name: String, initialLocation: Area) extends Entity(name, initialLo private val observedEvents: Buffer[Event] = Buffer.empty private var pendingSingEffect: Option[SingEffect] = None + override def observeString(observation: String): Unit = this.observations.append(observation) override def observe(event: Event): Unit = @@ -71,4 +72,7 @@ class Player(name: String, initialLocation: Area) extends Entity(name, initialLo )) event.foreach(this.location.observeEvent(_)) + + + end Player -- cgit v1.2.3