/** * Update all things up to the given time. * @param float $time */ public function update($time) { // update resources $this->income->update($time); // update hatcheries $this->hatcheries->update($time); // update spellcasters $this->spellcasters->update($time); // update production queues $this->queues->update($time); }
$income->basesOperational = array(true); $timeline->income[] = $income; } else { $income = new IncomeSlot(); $income->mineralMiners = array(6); $income->basesOperational = array(true); $timeline->income[] = $income; } // initial conditions if ($race == Protoss) { $timeline->spellcasters->add(new Spellcaster($Nexus, 0)); $timeline->farms->add(new Farm(0, $Nexus->supplyCapacity)); } elseif ($race == Terran) { $timeline->farms->add(new Farm(0, $CommandCenter->supplyCapacity)); } elseif ($race == Zerg) { Hatcheries::$debug = (bool) ($debugFlags & Hatcheries::debugFlag); $timeline->hatcheries->add(new Hatchery(0, 3)); $timeline->farms->add(new Farm(0, $Hatchery->supplyCapacity)); $timeline->farms->add(new Farm(0, $Overlord->supplyCapacity)); //$timeline->queues->add(new ProductionQueue($Hatchery)); } $timeline->queues->add(new ProductionQueue(Product::designated($race | Base))); $timeline->supplyCount = 6; // create recurring worker job $job = new BuildJob(Product::designated($race | Worker)); $job->recurring = true; $unscheduledJobs[] = $job; // schedule jobs $scheduler = new Scheduler($timeline, $unscheduledJobs); Scheduler::$debug = (bool) ($debugFlags & Scheduler::debugFlag); $scheduledJobs = $scheduler->schedule();