package scalevalapokalypsi.Model import scalevalapokalypsi.Model.Entities.Entity /** A description of an action. * * @param target the entity that was as a target in this event * @param inFirstPerson textual description of the event in first person * @param inThirdPerson textual description of the event in third person */ class Event( val target: Entity, val inFirstPerson: String, val inThirdPerson: String ): /** Gets the description of this event as seen by the given * entity. Note that this method does no checks whether the given entity * could even see the event, only what it would have looked like to them. * * @param entity the entity whose perspective to use * @return a textual description of the event */ def descriptionFor(entity: Entity): String = if entity == target then inFirstPerson else inThirdPerson end Event