> Class A requires additional info when using it. How to pass it to B? Your original question was: how to tell the PlayEngine "B" that Card "A" is something special?
If you follow the tell, don-t ask pattern you learn that player "X" tells specialCard "A" which color to use and specialCard "A" tells PlayEngine "B" which color to use.
You need two different types of card:
- most cards are of type "Card where color cannot be changed"
- and there are a few "Card where the player can tell the card which color it should have at runtime"
Both card types have a method play() that tells the PlayEngine which color is next
If your StandardCard also has a setColor() method (which i do not recomment) then it-s implementation should throw a PlayerIsCheetingException :-) )