Exemplo n.º 1
0
 public function PurchaseBuildings(array $resources, $firstItem)
 {
     $colony = $this->User()->CurrentColony();
     $buildGroup = BuildingBuildGroup::FromList($resources, $colony);
     $rb = new ResourceBuilder($buildGroup);
     $rb->BuildList()->AddToDatabase();
     if ($firstItem) {
         $rb->BuildList()->UpdateCommissionedTime();
     }
 }
Exemplo n.º 2
0
 private function ConstructBuilding(ResourceBuilder $rb)
 {
     if (count($rb->BuildList()->Members()) == 0) {
         return true;
     }
     // Nothing to do here
     // Get the first item on the list
     $unit = reset($rb->BuildList()->Members());
     echo "<br/>Unit about to be built: ";
     echo $unit;
     // Construct it (database is updated within)
     return $unit->Construct();
 }