Adding origin information to Buffs
Opened this issue · 0 comments
Currently, a Buff
on an entity does not bear any information on how this buff actually appeared.
This is annoying because it prevents for doing later things depending on the source (for example, who put the debuff/buff in the first place).
I believe this can be fixed by adding to Buff
a type parameter Source
representing the type of information representing the source. For exemple it could be Entity.Id
to tell that the buff was placed by that entity. Then concrete implementations of Buffs
should have a value source: Source
.
We could also be a bit more restrictive and create an ADT with possible sources, and ask that as a parameter. This, I believe, will fulfil everything that we need and will ease many other implementations.
Such an ADT could look like
sealed trait Source
case class FromEntity(entityId: Entity.Id) extends Source
case object FromGame extends Source
// ...