public addPopulator ( |
||
$populator |
public function addPopulator(Populator $populator)
{
$this->populators[] = $populator;
}
protected static function register($id, Biome $biome) { self::$biomes[(int) $id] = $biome; $biome->setId((int) $id); $biome->grassColor = self::generateBiomeColor($biome->getTemperature(), $biome->getRainfall()); $flowerPopFound = false; foreach ($biome->getPopulators() as $populator) { if ($populator instanceof Flower) { $flowerPopFound = true; break; } } if ($flowerPopFound === false) { $flower = new Flower(); $biome->addPopulator($flower); } }