Generator: small reduction of code duplication

This commit is contained in:
Dylan K. Taylor
2018-06-07 19:49:51 +01:00
parent 996935e9b2
commit 3c9af5cd6d
4 changed files with 12 additions and 19 deletions

View File

@@ -52,10 +52,18 @@ abstract class Generator{
return $convertedSeed;
}
/** @var ChunkManager */
protected $level;
/** @var Random */
protected $random;
abstract public function __construct(array $settings = []);
abstract public function init(ChunkManager $level, Random $random);
public function init(ChunkManager $level, Random $random){
$this->level = $level;
$this->random = $random;
}
abstract public function generateChunk(int $chunkX, int $chunkZ);