include('DartsGame.php'); session_start(); if($_REQUEST['action'] == "resetGame" || $_SERVER['REQUEST_URI'] == "/"){ $_SESSION['currentDataGame'] = new DartsGame(); } if($_REQUEST['action'] == "setGameType"){ $_SESSION['currentDataGame']->setGameType( $_REQUEST['value']); $_SESSION['currentDataGame']->setDoubleBull( $_REQUEST['doubleBullsEnabled']); } if($_REQUEST['action'] == "setNumberofTeams"){ $_SESSION['currentDataGame']->setNumberofTeams( $_REQUEST['value']); } if($_REQUEST['action'] == "setTeamNames"){ $_SESSION['currentDataGame']->setTeamNames( $_REQUEST['teamNames']); } if($_REQUEST['action'] == "setPlayerNames"){ $_SESSION['currentDataGame']->setPlayerNames($_REQUEST['numberofPlayersPerTeams'], $_REQUEST['playerNames']); if($_REQUEST['numberofPlayersEachMatch'] != 2 && $_REQUEST['numberofPlayersEachMatch'] != ""){ $_SESSION['currentDataGame']->setNumberofPlayersPerMatch(intval($_REQUEST['numberofPlayersEachMatch'])); } } if($_REQUEST['action'] == "setupcompletepreviewfirstmatch"){ $_SESSION['currentDataGame']->launchGame(); } if($_REQUEST['action'] == "firstRoundStart"){ $_SESSION['currentDataGame']->startRound1(); } if($_REQUEST['action'] == "saveThrowsAndNextTurn"){ $current_match = $_SESSION['currentDataGame']->getMatchNumber() -1; $_SESSION['currentDataGame']->matches[$current_match]->saveDartThrows($_REQUEST['playerTurnData']); } $current_match = $_SESSION['currentDataGame']->getMatchNumber() -1; ?>
//var_dump($_SESSION['currentDataGame']); ?> if($_SESSION['currentDataGame']->getGameStatus() == 1){ echo "need to select Game"; ?> Enter Default } if($_SESSION['currentDataGame']->getGameStatus() == 4){ echo "need to set player names"; ?>