示例#1
0
 public function CostIsDeductible(Cost $value)
 {
     $enoughMetal = $this->Metal() - $value->Metal() >= 0;
     $enoughCrystal = $this->Crystal() - $value->Crystal() >= 0;
     $enoughDeuterium = $this->Deuterium() - $value->Deuterium() >= 0;
     $enoughEnergy = $this->Energy() - $value->Energy() >= 0;
     if ($enoughMetal && $enoughCrystal && $enoughDeuterium && $enoughEnergy) {
         return true;
     }
     return false;
 }