Skip to main content
added 79 characters in body
Source Link
k3b
  • 7.6k
  • 1
  • 21
  • 31
 > 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 :-) )

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 :-) )

 > 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 :-) )

deleted 3 characters in body
Source Link
k3b
  • 7.6k
  • 1
  • 21
  • 31

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 getColor() special cards also have a setColorMethodplay() 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 :-) )

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 "Card where the player can tell the card which color it should have at runtime"

Both card types have a method getColor() special cards also have a setColorMethod()

If your StandardCard also has a setColor() method (which i do not recomment) then it-s implementation should throw a PlayerIsCheetingException :-) )

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 :-) )

added 203 characters in body
Source Link
k3b
  • 7.6k
  • 1
  • 21
  • 31

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 "Card where the player can tell the card which color it should have at runtime"

Both card types have a method getColor() special cards also have a setColorMethod()

If your StandardCard also has a setColor() method (which i do not recomment) then it-s implementation should throw a PlayerIsCheetingException :-) )

In the special case the player tells the special card which color it should repesent.

If you follow the tell, don-t ask pattern you need two different types of card:

  • most cards are of type "Card where color cannot be changed"
  • and "Card where the player can tell the card which color it should have at runtime"

Both card types have a method getColor() special cards also have a setColorMethod()

If your StandardCard also has a setColor() method (which i do not recomment) then it-s implementation should throw a PlayerIsCheetingException :-) )

In the special case the player tells the special card which color it should repesent.

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 "Card where the player can tell the card which color it should have at runtime"

Both card types have a method getColor() special cards also have a setColorMethod()

If your StandardCard also has a setColor() method (which i do not recomment) then it-s implementation should throw a PlayerIsCheetingException :-) )

added 203 characters in body
Source Link
k3b
  • 7.6k
  • 1
  • 21
  • 31
Loading
Source Link
k3b
  • 7.6k
  • 1
  • 21
  • 31
Loading