Package loveletter
Class LoveLetter
- java.lang.Object
-
- loveletter.LoveLetter
-
public class LoveLetter extends java.lang.Object
A class for running a single game of LoveLetter. An array of 4 agents is provided, a deal is initialised and players takes turns until the game ends and the score is reported.
-
-
Constructor Summary
Constructors Constructor Description LoveLetter()
Constructs a LoveLetter game.LoveLetter(long seed, java.io.PrintStream ps)
Constructs a LoveLetter game.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
This main method is provided to run a simple test game with provided agents.int[]
playGame(Agent[] agents)
Plays a game of LoveLetter
-
-
-
Constructor Detail
-
LoveLetter
public LoveLetter(long seed, java.io.PrintStream ps)
Constructs a LoveLetter game.- Parameters:
seed
- a seed for the random number generator.ps
- a PrintStream object to record the events of the game
-
LoveLetter
public LoveLetter()
Constructs a LoveLetter game. Defauklt construct with system random seed, and System.out as the PrintStream
-
-
Method Detail
-
playGame
public int[] playGame(Agent[] agents)
Plays a game of LoveLetter- Parameters:
agents
- the players in the game- Returns:
- scores of each agent as an array of integers
-
main
public static void main(java.lang.String[] args)
This main method is provided to run a simple test game with provided agents. The agent implementations should be in the default package.
-
-