addResult method

void addResult(
  1. String command,
  2. BasicShape state,
  3. Pair<int, int> position
)

It adds the current state, command, and position to the lists

Args: command (String): The command that was used to get to this state. state (Cross): The state of the board after the command is executed. position (Pair<int, int>): The position of the cell that was clicked.

Implementation

void addResult(String command, BasicShape state, Pair<int, int> position) {
  _states.add(state);
  _commands.add(command);
  _positions.add(position);
  partialCatScore = _partialCATScoreCalculator();
}