Logo Search packages:      
Sourcecode: filler version File versions  Download package

friendless::games::filler::Tournaments Class Reference

List of all members.


Detailed Description

A class which knows how to run tournaments. The tournament types are:
Round Robin
Each players plays every other player.
Knockout
Once a player loses a game, they are eliminated. The last player eliminated wins.
Basho
Each player plays the same number of games. The player with the highest number of wins wins the tournament.
Pepper
One player plays against every other opponent.
Challenge
Players issue challenges to other players.

Author:
John Farrell

Lang Sharpe

Definition at line 41 of file Tournaments.java.


Static Package Functions

static List allocateBasho (PlayerWrapper[] players, boolean[][] played, Map index)
static List allocateBasho (PlayerWrapper[] players, boolean[][] played, Map index, List allocatedPairs, boolean[] allocated)
static void basho (int rounds, FillerPanel panel, PlayerWrappers players)
static void cancel ()
static void challenge (FillerPanel panel, PlayerWrappers players)
static PlayerWrappers checkEvenNumberOfPlayers (PlayerWrappers players)
static PlayerWrapper getBestOpponent (PlayerWrapper challenger, PlayerWrappers players)
static void knockout (FillerPanel panel, PlayerWrappers players)
static int[] playTournamentMatches (int[][] indexes, FillerPanel panel, PlayerWrappers players, boolean recordResult)
static void roundRobin (FillerPanel panel, PlayerWrappers players)
static int[][] roundRobinMatches (int n)
static void setResources (ResourceBundle resources)
static void sortByRatings (PlayerWrapper[] players, int[] wins)
static void sortByWins (PlayerWrapper[] players, int[] wins)
static void tournament (TournamentRules rules, FillerPanel panel, PlayerWrappers players)

Static Package Attributes

static Random rng = new Random()

Static Private Member Functions

static boolean hasPlayed (PlayerWrapper p1, PlayerWrapper p2, boolean[][] played, Map index)
static int minIndex (PlayerWrapper[] players, boolean[] allocated)
static void playBashoMatches (FillerPanel panel, List pairs, PlayerWrapper[] players, int[] wins)
static void setPlayed (PlayerWrapper p1, PlayerWrapper p2, boolean[][] played, Map index, boolean value)
static void swap (Object[] objs, int[] vs, int i, int j)
static void tieBreaker (FillerPanel panel, PlayerWrapper[] players, int[] wins)

Static Private Attributes

static boolean cancelled
static ResourceBundle resources
static final String SEP = System.getProperty("line.separator")

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index