Games
in package
Tournament generator sorter for games
WORKS BY COMPARING AVAILABLE GAMES BY THEIR TEAMS TEAMS FROM LAST 3 GAMES 1 = PLAYED ONLY 3RD GAME FROM END 2 = PLAYED ONLY 2ND GAME FROM END 3 = PLAYED 3RD AND 2ND GAME FROM END 4 = PLAYED ONLY THE LAST GAME 5 = PLAYED 3RD AND 1ST GAME FROM END 6 = PLAYED 2ND ANS 1ST GAME FROM END 7 = PLAYED ALL 3 LAST GAMES
Tags
Table of Contents
- $games : array<string|int, mixed>
- $group : Group
- __construct() : mixed
- Orders games from group
- orderGames() : array<string|int, mixed>
- Orders games from group
- cycle1() : bool
- Teams that did not play in the last game (< 4)
- cycle2() : bool
- Teams that did not play in the last two games (not 6 or 7)
- cycle3() : bool
- Teams that did not play in the last three games (not 7) and teams that did not play in the last game (< 4)
- cycle4() : bool
- Teams that did not play in the last three games (not 7)
- cycle5() : bool
- Teams that did not play in the last game will play this game (< 4)
- moveCalculatedGames() : void
- Move teams that did not play in the last game (< 4)
- orderCheckTeamsVal() : bool
- Get first available game
Properties
$games
private
array<string|int, mixed>
$games
= []
$group
private
Group
$group
Methods
__construct()
Orders games from group
public
__construct(Group $group) : mixed
Parameters
- $group : Group
Return values
mixed —orderGames()
Orders games from group
public
orderGames() : array<string|int, mixed>
Return values
array<string|int, mixed> —cycle1()
Teams that did not play in the last game (< 4)
private
cycle1(array<string|int, mixed> &$games, array<string|int, mixed> &$teams) : bool
Parameters
- $games : array<string|int, mixed>
- $teams : array<string|int, mixed>
Return values
bool —cycle2()
Teams that did not play in the last two games (not 6 or 7)
private
cycle2(array<string|int, mixed> &$games, array<string|int, mixed> &$teams) : bool
Parameters
- $games : array<string|int, mixed>
- $teams : array<string|int, mixed>
Return values
bool —cycle3()
Teams that did not play in the last three games (not 7) and teams that did not play in the last game (< 4)
private
cycle3(array<string|int, mixed> &$games, array<string|int, mixed> &$teams) : bool
Parameters
- $games : array<string|int, mixed>
- $teams : array<string|int, mixed>
Return values
bool —cycle4()
Teams that did not play in the last three games (not 7)
private
cycle4(array<string|int, mixed> &$games, array<string|int, mixed> &$teams) : bool
Parameters
- $games : array<string|int, mixed>
- $teams : array<string|int, mixed>
Return values
bool —cycle5()
Teams that did not play in the last game will play this game (< 4)
private
cycle5(array<string|int, mixed> &$games, array<string|int, mixed> &$teams) : bool
Parameters
- $games : array<string|int, mixed>
- $teams : array<string|int, mixed>
Return values
bool —moveCalculatedGames()
Move teams that did not play in the last game (< 4)
private
moveCalculatedGames(Game $game, array<string|int, mixed> &$teams) : void
Parameters
- $game : Game
- $teams : array<string|int, mixed>
Return values
void —orderCheckTeamsVal()
Get first available game
private
orderCheckTeamsVal(Game $game, array<string|int, mixed> $teams, array<string|int, mixed> $checkVals[, array<string|int, mixed> $required = [] ]) : bool
Parameters
- $game : Game
- $teams : array<string|int, mixed>
- $checkVals : array<string|int, mixed>
- $required : array<string|int, mixed> = []