Beispiel #1
0
 /**
  * Crée un faux Qg qui n'existe pas en base, pour calculer les coûts de déplacement
  * @param int $type Type de QG à créer
  */
 public function setFakeQg($type)
 {
     $this->fakeQg = new Qg();
     $this->fakeQg->setIdTypeQg($type);
     $this->fakeQg->setIdJoueur($this->qg->getIdJoueur());
     $unite = new Unite();
     switch ($type) {
         case Unites::TYPE_TERRESTRE:
             $unite->setIdType(Unites::RAVITAILLEUR_AMPHIBIE);
             break;
         case Unites::TYPE_NAVAL:
             $unite->setIdType(Unites::DESTROYER);
             break;
         case Unites::TYPE_AERIEN:
             $unite->setIdType(Unites::BOMBARDIER);
             break;
         default:
             $unite->setIdType(Unites::RAVITAILLEUR_AMPHIBIE);
     }
     $unite->setMoral(100);
     $unites = new UniteCollection();
     $unites->ajout($unite);
     $this->fakeQg->setUnites($unites);
 }
Beispiel #2
0
 /**
  * Crée un Qg lié à ce Joueur
  * @return Qg
  */
 public function createQg()
 {
     $qg = new Qg();
     $qg->setIdJoueur($this->getIdJoueur());
     return $qg;
 }