You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently GameState knows about Decision and vice versa. This is not really good design and should be eliminated. When solved, it will make the program easier to reason about. Also, it doesn't force a bad practice onto interface implementers.
GameState's knowledge lies in GameState::getDecisions(): Decision[] and Decision's knowledge lies in Decision::apply(GameState): GameState.
One possible solution is to move apply from Decision to GameState. It could also help to think about extracting a Board class from GameState and making only that known to Decision. However, care should be taken to keep the interface as simple as needed.
The text was updated successfully, but these errors were encountered:
Currently
GameState
knows aboutDecision
and vice versa. This is not really good design and should be eliminated. When solved, it will make the program easier to reason about. Also, it doesn't force a bad practice onto interface implementers.GameState
's knowledge lies inGameState::getDecisions(): Decision[]
andDecision
's knowledge lies inDecision::apply(GameState): GameState
.One possible solution is to move
apply
fromDecision
toGameState
. It could also help to think about extracting aBoard
class fromGameState
and making only that known toDecision
. However, care should be taken to keep the interface as simple as needed.The text was updated successfully, but these errors were encountered: