本文整理汇总了Python中horizons.messaging.WorldObjectDeleted类的典型用法代码示例。如果您正苦于以下问题:Python WorldObjectDeleted类的具体用法?Python WorldObjectDeleted怎么用?Python WorldObjectDeleted使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WorldObjectDeleted类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, session, building, ship=None, build_related=None):
super(BuildingTool, self).__init__(session)
assert not (ship and build_related)
self.renderer = self.session.view.renderer['InstanceRenderer']
self.ship = ship
self._class = building
self.__init_selectable_component()
self.buildings = [] # list of PossibleBuild objs
self.buildings_action_set_ids = [] # list action set ids of list above
self.buildings_fife_instances = {} # fife instances of possible builds
self.buildings_missing_resources = {} # missing resources for possible builds
self.rotation = 45 + random.randint(0, 3)*90
self.start_point, self.end_point = None, None
self.last_change_listener = None
self._transparencified_instances = set() # fife instances modified for transparency
self._buildable_tiles = set() # tiles marked as buildable
self._related_buildings = set() # buildings highlighted as related
self._highlighted_buildings = set() # related buildings highlighted when preview is near it
self._build_logic = None
self._related_buildings_selected_tiles = frozenset() # highlights w.r.t. related buildings
if self.ship is not None:
self._build_logic = ShipBuildingToolLogic(ship)
elif build_related is not None:
self._build_logic = BuildRelatedBuildingToolLogic(self, weakref.ref(build_related) )
else:
self._build_logic = SettlementBuildingToolLogic(self)
self.load_gui()
self.__class__.gui.show()
self.session.ingame_gui.minimap_to_front()
self.session.gui.on_escape = self.on_escape
self.highlight_buildable()
WorldObjectDeleted.subscribe(self._on_worldobject_deleted)
示例2: __init__
def __init__(self, session):
self.session = session
# {instance: [list of icons]}
self.icons = {}
# Renderer used to render the icons
self.renderer = self.session.view.renderer['GenericRenderer']
AddStatusIcon.subscribe(self.on_add_icon_message)
RemoveStatusIcon.subscribe(self.on_remove_icon_message)
WorldObjectDeleted.subscribe(self.on_worldobject_deleted_message)
示例3: __init__
def __init__(self, session):
super(TearingTool, self).__init__(session)
self.coords = None
self.selected = WeakList()
self.oldedges = None
self.tear_tool_active = True
self.session.ingame_gui.hide_menu()
self.session.selected_instances.clear()
horizons.globals.fife.set_cursor_image("tearing")
self._hovering_over = WeakList()
WorldObjectDeleted.subscribe(self._on_object_deleted)
示例4: end
def end(self):
self.tooltip_instance = None
self.tooltip_icon.hide_tooltip()
self.tooltip_icon = None
self.renderer = None
self.icons = None
AddStatusIcon.unsubscribe(self.on_add_icon_message)
HoverInstancesChanged.unsubscribe(self.on_hover_instances_changed)
RemoveStatusIcon.unsubscribe(self.on_remove_icon_message)
WorldObjectDeleted.unsubscribe(self.on_worldobject_deleted_message)
示例5: __init__
def __init__(self, session):
self.session = session
# {instance: [list of icons]}
self.icons = {}
# Renderer used to render the icons
self.renderer = self.session.view.renderer['GenericRenderer']
self.tooltip_instance = None # no weakref:
# we need to remove the tooltip always anyway, and along with it the entry here
self.tooltip_icon = Icon(position=(1,1)) # 0, 0 is currently not supported by tooltips
AddStatusIcon.subscribe(self.on_add_icon_message)
HoverInstancesChanged.subscribe(self.on_hover_instances_changed)
RemoveStatusIcon.subscribe(self.on_remove_icon_message)
WorldObjectDeleted.subscribe(self.on_worldobject_deleted_message)
示例6: remove
def remove(self):
WorldObjectDeleted.unsubscribe(self._on_worldobject_deleted)
self._remove_listeners()
self._remove_building_instances()
self._remove_coloring()
self._build_logic.remove(self.session)
self._buildable_tiles = None
self._transparencified_instances = None
self._related_buildings_selected_tiles = None
self._related_buildings = None
self._highlighted_buildings = None
self._build_logic = None
self.buildings = None
if self.gui is not None:
self.session.view.remove_change_listener(self.draw_gui)
self.gui.hide()
ExtScheduler().rem_all_classinst_calls(self)
super(BuildingTool, self).remove()
示例7: __init__
def __init__(self, renderer, layer):
"""
@param renderer: Renderer used to render the icons
@param layer: map layer, needed to place icon
"""
self.layer = layer
self.renderer = renderer
# {instance: [list of icons]}
self.icons = {}
self.tooltip_instance = None # no weakref:
# we need to remove the tooltip always anyway, and along with it the entry here
self.tooltip_icon = Icon(position=(1, 1)) # 0, 0 is currently not supported by tooltips
AddStatusIcon.subscribe(self.on_add_icon_message)
HoverInstancesChanged.subscribe(self.on_hover_instances_changed)
RemoveStatusIcon.subscribe(self.on_remove_icon_message)
WorldObjectDeleted.subscribe(self.on_worldobject_deleted_message)
示例8: remove
def remove(self):
self.session.ingame_gui.resource_overview.close_construction_mode()
WorldObjectDeleted.unsubscribe(self._on_worldobject_deleted)
self._remove_listeners()
self._remove_building_instances()
self._remove_coloring()
self._build_logic.remove(self.session)
self._buildable_tiles = None
self._transparencified_instances = None
self._related_buildings_selected_tiles = None
self._related_buildings = None
self._highlighted_buildings = None
self._build_logic = None
self.buildings = None
if self.__class__.gui is not None:
self.__class__.gui.hide()
ExtScheduler().rem_all_classinst_calls(self)
SettlementInventoryUpdated.discard(self.update_preview)
PlayerInventoryUpdated.discard(self.update_preview)
super(BuildingTool, self).remove()
示例9: remove
def remove(self):
self._mark()
self.tear_tool_active = False
horizons.globals.fife.set_cursor_image("default")
WorldObjectDeleted.unsubscribe(self._on_object_deleted)
super(TearingTool, self).remove()
示例10: remove
def remove(self):
WorldObjectDeleted.broadcast(self, self, self.worldid)
super(WorldObject, self).remove()
self.log.debug("Removing WorldObject %s %s", self.worldid, self)
del WorldObject.__objects[self.worldid]