Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
0adbae8e90
@ -1,12 +1,22 @@
|
||||
<?php
|
||||
include_once "EnigmeFactory.php";
|
||||
include_once "../Model/Partie.php";
|
||||
class PartieFactory{
|
||||
public static function create($results)
|
||||
public static function createPartie($idMax,$resultsEnigme) : Partie
|
||||
{
|
||||
$tabPartie=array();
|
||||
foreach($results as $row)
|
||||
$tempsResolutionPartie=0;
|
||||
$tabEnigme=array();
|
||||
$tabIndex=range(0,strlen($resultsEnigme)-1);
|
||||
$randomNumber=0;
|
||||
while($tempsResolutionPartie <= 30)
|
||||
{
|
||||
$tabPartie= new Partie($row['id']);
|
||||
$randomNumber=$tabIndex[array_rand($tabIndex)];
|
||||
$tabEnigme=EnigmeFactory::create($resultsEnigme[$randomNumber]);
|
||||
$TempsResolutionPartie+=$resultsEnigme[$randomNumber]['tempsDeResolution'];
|
||||
unset($tabIndex[$randomNumber]);
|
||||
}
|
||||
return $tabPartie;
|
||||
$partie=new Partie($idMax,$resultsEnigme);
|
||||
return $partie;
|
||||
}
|
||||
//public static function createListePartie()
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"bootstrap": "^5.2.2"
|
||||
"bootstrap": "^5.2.2",
|
||||
"bootstrap-icons": "^1.10.2"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue