function getTournamentObject($tournament) { require_once "participant.interface.php"; require_once "singlePlayer.class.php"; require_once "group.class.php"; require_once "register.class.php"; $register = new Register(); require_once "tournament.abstract.class.php"; switch ($tournament['mode']) { case 1: //Single Elimination require_once "tournament.singleelimination.class.php"; $tournament_obj = new SingleElimination($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 2: // Double Elimination require_once "tournament.doubleelimination.class.php"; $tournament_obj = new DoubleElimination($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 3: // Groups require_once "tournament.groups.class.php"; $tournament_obj = new Groups($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 4: // Points require_once "tournament.points.class.php"; $tournament_obj = new Points($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 5: // Randomize require_once "tournament.randomize.class.php"; $tournament_obj = new Randomize($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 6: // King of the Hill require_once "tournament.koth.class.php"; $tournament_obj = new KotH($tournament['tournamentid'], $register->getParticipants($tournament)); break; case 7: // KDeathmatch require_once "tournament.deathmatch.class.php"; $tournament_obj = new Deathmatch($tournament['tournamentid'], $register->getParticipants($tournament)); break; default: break; } return $tournament_obj; }
$menu->addSubElement($mod, $lang->get('tournament_table'), 'table', array('tournamentid' => $tournamentid)); } @$breadcrumbs->addElement($tournament['event']['name'], makeURL($mod, array('eventid' => $tournament['event']['eventid']))); $breadcrumbs->addElement($tournament['title'], makeURL($mod, array('tournamentid' => $tournamentid))); // Create a new instance of tournament class require_once $mod_dir . "/tournament.abstract.class.php"; require_once $mod_dir . "/participant.interface.php"; require_once $mod_dir . "/singlePlayer.class.php"; require_once $mod_dir . "/group.class.php"; require_once $mod_dir . "/tournament.eliminationencounter.class.php"; global $tournament_obj; switch ($tournament['mode']) { case 1: // Single Elimination require_once $mod_dir . "/tournament.singleelimination.class.php"; $tournament_obj = new SingleElimination($tournamentid, $register->getParticipants($tournament)); break; case 2: // Double Elimination require_once $mod_dir . "/tournament.doubleelimination.class.php"; $tournament_obj = new DoubleElimination($tournamentid, $register->getParticipants($tournament)); break; case 3: // Groups require_once $mod_dir . "/tournament.groups.class.php"; $tournament_obj = new Groups($tournamentid, $register->getParticipants($tournament)); break; case 4: // Points require_once $mod_dir . "/tournament.points.class.php"; $tournament_obj = new Points($tournamentid, $register->getParticipants($tournament));