Example #1
0
 def biome_at(self, pos):
     x, y = pos
     b = Biome.by_name(self.biome[y, x])
     if b is None:
         raise Exception('Not found')
     return b
Example #2
0
 def test_biome_by_name(self):
     self.assertRaises(Exception, Biome.by_name, "unexisting biome")
     self.assertTrue(isinstance(Biome.by_name("ocean"), Ocean))
Example #3
0
 def biome_at(self, pos):
     x, y = pos
     b = Biome.by_name(self.layers['biome'].data[y, x])
     if b is None:
         raise Exception('Not found')
     return b
Example #4
0
 def test_biome_colors(self):
     self.assertEqual(Biome.all_names(), sorted(_biome_colors.keys()))
Example #5
0
 def biome_at(self, pos):
     x, y = pos
     b = Biome.by_name(self.biome[y, x])
     if b is None:
         raise Exception('Not found')
     return b
Example #6
0
 def biome_at(self, pos):
     x, y = pos
     b = Biome.by_name(self.layers['biome'].data[y, x])
     if b is None:
         raise Exception('Not found')
     return b
Example #7
0
 def test_biome_colors(self):
     self.assertEqual(Biome.all_names(), sorted(_biome_colors.keys()))
Example #8
0
 def test_biome_by_name(self):
     self.assertRaises(Exception, Biome.by_name, "unexisting biome")
     self.assertTrue(isinstance(Biome.by_name("ocean"), Ocean))