public function decide(GameState $state): GameState
    {
        if (!$state->getNextPlayer()->equals($this->objectivePlayer)) {
            throw new BadMethodCallException('It is not this players turn');
        }
        if (empty($state->getPossibleMoves())) {
            throw new RuntimeException('There are no possible moves');
        }

        $rootNode = new DecisionNode(
            $this->objectivePlayer,
            $state,
            $this->maxDepth,
            NodeType::MAX(),
            AlphaBeta::initial()
        );

        $moveWithEvaluation = $rootNode->traverseGameTree();
        $this->analytics = $moveWithEvaluation->analytics;
        if ($moveWithEvaluation->move === null) {
            throw new LogicException('Could not find move even though there are moves. Is the maxdepth parameter correct?');
        }
        return $moveWithEvaluation->move;
    }