예제 #1
0
def map_():
    map_ = libtcodpy.map_new(MAP_WIDTH, MAP_HEIGHT)
    for y, line in enumerate(MAP):
        for x, ch in enumerate(line):
            libtcodpy.map_set_properties(map_, x, y, ch == ' ', ch == ' ')
    yield map_
    libtcodpy.map_delete(map_)
예제 #2
0
def test_map():
    map = libtcodpy.map_new(16, 16)
    assert libtcodpy.map_get_width(map) == 16
    assert libtcodpy.map_get_height(map) == 16
    libtcodpy.map_copy(map, map)
    libtcodpy.map_clear(map)
    libtcodpy.map_set_properties(map, 0, 0, True, True)
    assert libtcodpy.map_is_transparent(map, 0, 0)
    assert libtcodpy.map_is_walkable(map, 0, 0)
    libtcodpy.map_is_in_fov(map, 0, 0)
    libtcodpy.map_delete(map)
예제 #3
0
파일: paths.py 프로젝트: ludamad/7DayRL2013
 def __del__(self):
     libtcod.map_delete(self.map)
     libtcod.path_delete(self.path)
     self.map, self.path = None, None
예제 #4
0
파일: level.py 프로젝트: nrook/Spirit
    def __del__(self):
        """
        The sight map must be manually garbage-collected.
        """

        tcod.map_delete(self.sight_map)
예제 #5
0
 def close(self):
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
예제 #6
0
 def close(self):
     """Clean up lighting assets prior to deleting object"""
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
     self.light_enabled = False
예제 #7
0
 def __del__(self):
     libtcod.map_delete(self.map)
     libtcod.path_delete(self.path)
     self.map, self.path = None, None
예제 #8
0
 def close(self):
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
예제 #9
0
 def close(self):
     """Clean up lighting assets prior to deleting object"""
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
     self.light_enabled = False
예제 #10
0
 def __del__(self): # garbage collect
     libtcod.map_delete(self.map)
     self.map = None