Biome: make biomes list use an SplFixedArray

This commit is contained in:
Dylan K. Taylor 2018-06-08 10:07:57 +01:00
parent c8a87b14d5
commit 8c6161a4f2

View File

@ -52,8 +52,8 @@ abstract class Biome{
public const MAX_BIOMES = 256;
/** @var Biome[] */
private static $biomes = [];
/** @var Biome[]|\SplFixedArray */
private static $biomes;
/** @var int */
private $id;
@ -82,6 +82,8 @@ abstract class Biome{
}
public static function init(){
self::$biomes = new \SplFixedArray(self::MAX_BIOMES);
self::register(self::OCEAN, new OceanBiome());
self::register(self::PLAINS, new PlainBiome());
self::register(self::DESERT, new DesertBiome());