from game import MancalaNode, GameTreeSearcher, MancalaPlayer

# TODO: This file is an assignment template.  You should copy it, substitute your unique player ID for "UniqueID"
# throughout the copied file, and implement (1) two heuristics in ____1MancalaNode and ____2MancalaNode,
# (2) fixed-depth minimax with alpha-beta pruning in ____AlphaBetaSearcher, and
# (3) implement your best ____MancalaPlayer below utilizing the best of (1) and (2) and with better
# time management than SimpleMancalaPlayer.

class UniqueID1MancalaNode(MancalaNode):

    def utility(self):
        """Return an estimation of game node utility. However, if the game is over, return the actual utility."""
        # TODO: In your implementation, replace UniqueID with your unique ID,
        # and implement a different utility function.
        return self.state[MancalaNode.MAX_SCORE_PIT] - self.state[MancalaNode.MIN_SCORE_PIT]


class UniqueID2MancalaNode(MancalaNode):

    def utility(self):
        """Return an estimation of game node utility. However, if the game is over, return the actual utility."""
        # TODO: In your implementation, replace UniqueID with your unique ID,
        # and implement a different utility function.
        return self.state[MancalaNode.MAX_SCORE_PIT] - self.state[MancalaNode.MIN_SCORE_PIT]


class UniqueIDAlphaBetaSearcher(GameTreeSearcher):
    """Depth-limited minimax game tree searcher with alpha-beta pruning."""

    def __init__(self, depth_limit):
        """Create a depth-limited minimax game tree searcher with alpha-beta pruning"""
        pass  # TODO: implement

    def eval(self, node):
        pass  # TODO: Implement

    def get_best_move(self):
        pass  # TODO: Implement

    def get_node_count(self):
        pass  # TODO: Implement


class UniqueIDMancalaPlayer(MancalaPlayer):
    def choose_move(self, node, ms_remaining):
        """This is where your code takes over as a MancalaPlayer.  You must implement this method.
        See SimpleMancalaPlayer for an example implementation with minimax.  You are given the current MancalaNode
        and the time remaining in milliseconds.  You are to return a legal move integer.  Your game clock runs until you
        return your legal move, so budget your time well.  You can need to first create a new node of your own type (say
        UniqueIDMancalaNode), and have your entire search work with your own node types and thus your own evaluation
        function."""
        pass  # TODO: Implement
