aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Model/Area.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Model/Area.scala')
-rw-r--r--src/scalevalapokalypsi/Model/Area.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/scalevalapokalypsi/Model/Area.scala b/src/scalevalapokalypsi/Model/Area.scala
index f534309..96392ba 100644
--- a/src/scalevalapokalypsi/Model/Area.scala
+++ b/src/scalevalapokalypsi/Model/Area.scala
@@ -33,6 +33,13 @@ class Area(val name: String, var description: String):
def getEntities: Iterable[Entity] = this.entities.values
def getEntity(name: String): Option[Entity] = this.entities.get(name)
+ /** Makes all entities in this area observe the given event.
+ *
+ * @param event the event to observe.
+ */
+ def observeEvent(event: Event): Unit =
+ this.getEntities.foreach(_.observe(event))
+
/** Tells whether this area has a neighbor in the given direction.
*
* @param direction the direction to check