Ejemplo n.º 1
0
 public static function getActivePosition($tigerId, $goatId)
 {
     $game = GamePlay::where('tiger_user_id', $tigerId)->where('goat_user_id', $goatId)->first();
     $tigerPosition = json_decode($game['tiger_position'], true);
     $goatPosition = json_decode($game['goat_position'], true);
     $nextMove = $game['next_move'];
     $goat = false;
     $tiger = false;
     ${$nextMove} = true;
     $allActivePosition = (new Initiate())->insertAnimal($tigerPosition, new Tiger())->insertAnimal($goatPosition, new Goat())->setNextMove($tiger, $goat);
     return $allActivePosition;
 }