Package loveletter

Interface Agent

  • All Known Implementing Classes:
    RandomAgent

    public interface Agent
    An interface for representing an agent in the game Love Letter All agent's must have a 0 parameter constructor
    • Method Detail

      • toString

        java.lang.String toString()
        Reports the agents name
        Overrides:
        toString in class java.lang.Object
      • newRound

        void newRound​(State start)
        Method called at the start of a round
        Parameters:
        start - the initial state of the round
      • see

        void see​(Action act,
                 State results)
        Method called when any agent performs an action.
        Parameters:
        act - the action an agent performs
        results - the state of play the agent is able to observe.
      • playCard

        Action playCard​(Card c)
        Perform an action after drawing a card from the deck
        Parameters:
        c - the card drawn from the deck
        Returns:
        the action the agent chooses to perform
        Throws:
        IllegalActionException - when the Action produced is not legal.