コード例 #1
0
ファイル: landscape.py プロジェクト: serpent-project/serpent
class BiomeMap(Map):
    def __init__(self, parent,
                 size=None,
                 sync=None,
                 height_noise=MidpointDisplacementNoise,
                 tile_noise=WhiteNoise,
                 sea_level=0.2,
                 ):
        self.height_noise = height_noise
        self.tile_noise = tile_noise
        self.sea_level = sea_level
        self.biomes = {}
        self.continents = ContinentManager()
        if not sync:
            sync = BiomeMapSync(self)
        super(BiomeMap, self).__init__(parent, size, sync)

    def get_biome(self, block):
        return self.continents.get_biome(block)

    def block_postprocess(self, block):
        """
            we wake up our neighbours.
            we apply dragon filters automagically.
            note: this should be a continental thing
        """
        if not block.processed:
            self.get_all_neighbours(block, wake_up=True)
            if not block.protected:
                quanum.apply(block, levels=ALL_RUNLEVELS)
                #dragon_scripts.apply(block, levels=ALL_RUNLEVELS)

            block.processed = True
コード例 #2
0
ファイル: landscape.py プロジェクト: serpent-project/serpent
 def __init__(self, parent,
              size=None,
              sync=None,
              height_noise=MidpointDisplacementNoise,
              tile_noise=WhiteNoise,
              sea_level=0.2,
              ):
     self.height_noise = height_noise
     self.tile_noise = tile_noise
     self.sea_level = sea_level
     self.biomes = {}
     self.continents = ContinentManager()
     if not sync:
         sync = BiomeMapSync(self)
     super(BiomeMap, self).__init__(parent, size, sync)