Example #1
0
 public function fight()
 {
     while ($this->manoA->isAlive() && $this->manoB->isAlive()) {
         echo $this->manoA->attack($this->manoB) . PHP_EOL;
     }
     if ($this->manoA->isAlive()) {
         return $this->manoA->getName() . " won!" . PHP_EOL;
     } else {
         return $this->manoB->getName() . " won!" . PHP_EOL;
     }
 }
Example #2
0
 public function testIsAlive()
 {
     $this->MW_Mano = new MW_Mano('Gil');
     $this->MW_Mano->resetHealth();
     //Verificar vivo ao nascer
     $this->assertTrue($this->MW_Mano->isAlive());
     //Verificar vivo apos se machucar
     $this->MW_Mano->hurt(50);
     $this->assertTrue($this->MW_Mano->isAlive());
     //Verificar vivo ap—s apanhar ate a morte
     $this->MW_Mano->hurt(50);
     $this->assertFalse($this->MW_Mano->isAlive());
 }