I want to have classes that can mix only specified traits:
class Peter extends Human with Lawful with Evil
class Mag extends Elf with Chaotic with Neutral
Is in scala a way to do this?
UPD:
trait Law
trait Lawful extends Law
trait LNeutral extends Law
trait Chaotic extends Law
trait Moral
trait Good extends Moral
trait Neutral extends Moral
trait Evil extends Moral
class Hero .........
class Homer extends Hero with Chaotic with Good
I want to define Hero class in way to constrain client programmer to mix specific traits (Lawful/LNeutral/Chaotic and Good/Neutral/Evil) if he extends Hero class. And I want to find some another possibilities to restrictions/constrainments of client code like this.