From 304a1f0fd9b159ff1308f0a20eeb250553b605d1 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 11 Jul 2016 19:06:51 +0200 Subject: [PATCH] return lap info --- src/arenas/tron/act.php | 58 +---------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/src/arenas/tron/act.php b/src/arenas/tron/act.php index 7cc5a3f..fc1f82b 100644 --- a/src/arenas/tron/act.php +++ b/src/arenas/tron/act.php @@ -66,63 +66,7 @@ switch ($_POST['act']){ 'lap' => $lap )); die; - /* - //make the board array - for ($botCount = 0; $botCount < count($bots); $botCount ++){ - $board[$botCount] = $bots[$botCount]->getTail(); - } - - $busyCells = array(); //les cases prises - $responses = array(); - $loosingBots = array(); - $targets = array(); - for ($botCount = 0; $botCount < count($bots); $botCount ++){ - - if($bots[$botCount]->getStatus()){ - $messageArr = array( - 'game-id' => '', - 'action' => 'play-turn', - 'game' => 'tron', - 'board' => $board, - 'player-index' => $botCount, // To do: verifier que ça restera le même à chaque tour - 'players' => $_SESSION['players'] - ); - - $busyCells = array_merge($busyCells, $bots[$botCount]->getTail()); - $responses[$botCount] = get_IA_Response($bots[$botCount]->getURL(),$messageArr); - print_r($responses[$botCount]); - if(in_array($bots[$botCount]->getTargetCell($responses[$botCount]['responseArr']['play']), $busyCells)){ - //this bot plays on a non empty cell, it looses - $bots[$botCount]->loose(); - $logs.= $bots[$botCount]->getName()." Played on a non empty cell, he loses.
"; - $loosingBots[] = $bots[$botCount]->getName(); - }else{ - $targets[] = $bots[$botCount]->getTargetCell($responses[$botCount]['responseArr']['play']); - } - - } - } - //test if some bots plays at the same place - for ($botCount = 0; $botCount < count($bots); $botCount ++){ - if($bots[$botCount]->getStatus()){ - - } - } - - - - //save pat game betwin loosing bots - save_draw_bots($loosingBots); - //find losing bots - - - - - - print_r($targets); - - */ - die; + break; default: break;