示例#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
示例#2
0
 def test_biome_by_name(self):
     self.assertRaises(Exception, Biome.by_name, "unexisting biome")
     self.assertTrue(isinstance(Biome.by_name("ocean"), Ocean))
示例#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
示例#4
0
 def test_biome_colors(self):
     self.assertEqual(Biome.all_names(), sorted(_biome_colors.keys()))
示例#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
示例#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
示例#7
0
 def test_biome_colors(self):
     self.assertEqual(Biome.all_names(), sorted(_biome_colors.keys()))
示例#8
0
 def test_biome_by_name(self):
     self.assertRaises(Exception, Biome.by_name, "unexisting biome")
     self.assertTrue(isinstance(Biome.by_name("ocean"), Ocean))