public class GameFight<T> extends Object
| Constructor and Description |
|---|
GameFight() |
GameFight(String label) |
GameFight(String label,
boolean useSeparateIndexes) |
| Modifier and Type | Method and Description |
|---|---|
FightResults<T> |
fightEvenly(T[] fighters,
int gamesPerGroup,
FightInterface<T> fightStrategy)
Creates 1 vs. 1 games for each possible combination of fighters and fights them against each other.
|
FightResults<T> |
fightRandom(T[] fighters,
int count,
FightInterface<T> fightStrategy)
Perform a specific number of randomly selected 1 vs. 1 fights.
|
public GameFight(String label, boolean useSeparateIndexes)
label - The name of this fight, which will be showed in the outputuseSeparateIndexes - True to alternate fighters between index 0 and index 1.public GameFight(String label)
public GameFight()
public FightResults<T> fightEvenly(T[] fighters, int gamesPerGroup, FightInterface<T> fightStrategy)
fighters - An array of the fightersgamesPerGroup - How many fights each 1 vs. 1 pair should make.fightStrategy - An interface providing implementation to determine the winner of a fightpublic FightResults<T> fightRandom(T[] fighters, int count, FightInterface<T> fightStrategy)
fighters - Array of fighters that can be chosen to participate in fightscount - The number of fights to make in totalfightStrategy - An interface providing implementation to determine the winner of a fightCopyright © 2015. All rights reserved.