game - adQuid/DecentAI GitHub Wiki

The Game interface represents the full state of your game. This is intended to represent the full model of your game, but should avoid including anything else (particularly view and controller elements not essential to running game rules) not needed to resolve ending the turn, because Decent AI works by copying the Game object many times and ending the turn under different scenarios.

Every Game is expected to contain a list of Players, which are each in turn expected to contain a list of Actions. Mutating these Action lists are the way Decent AI communicates with the game model. Implementations of actions are defined by you and provided by the IdeaGenerator class, but because DecentAI will play around with these ideas:

  • Any implementation of Game MUST be able to run with an empty list of actions for any given player.

The GameCloner interface is provided as a way to copy the game without just using the clone() method, if desired. In practice I've found that most bugs with AI behavior are actually failures to clone some part of the model.