I'm making a strategic game and I try to apply what I learned, try to use immutable data. In my game I have Units, these units can have different special function. By exemple some plane can hide themselves. What I search is a way to be able to do some sort of
abstract class Units {
val life:Int
}
trait Hidable { self: Units =>
val hided:Boolean
def hide:Units with Hidable= ....
}
without having to copy paste:
def hide = copy(hided=true)
on every case class that mixin Hidable.