Exemple #1
0
 protected function processData()
 {
     //roll dice
     $conn = getDatabaseConnection();
     $dice = array();
     for ($i = 0; $i < 6; $i++) {
         array_push($dice, rand(1, 6));
     }
     $rollDiceQuery = new RollDiceQuery($conn, $this->game, $dice);
     $rollDiceQuery->query();
     return true;
 }
Exemple #2
0
 protected function processData()
 {
     //add game
     $conn = getDatabaseConnection();
     $addGameQuery = new AddGameQuery($conn, $this->player1, $this->player2);
     $addGameQuery->query();
     //roll dice
     $dice = array();
     for ($i = 0; $i < 6; $i++) {
         array_push($dice, rand(1, 6));
     }
     $rollDiceQuery = new RollDiceQuery($conn, $conn->insert_id, $dice);
     $rollDiceQuery->query();
     return true;
 }