wolfhece._drowning_manager
Drowning-victim companion object for WolfMapViewer.
All drowning-simulation management logic lives here.
WolfMapViewer holds a single instance as self._drowning and exposes
one-line delegators so that external callers remain unaffected.
Design notes
DrowningManagerowns theactive_drowningreference, themydrowningslist, and all menu state (menudrowninghierarchy + check-item references).The wx parent for dialogs and menus is always
self._viewer.menu_build()is idempotent — the first call creates and appends the “Drowning” menu to the menubar; subsequent calls are no-ops.on_menu()is bound to the wx menu and dispatches all drowning commands.new_drowning()handles both “Create” and “Add” from the object toolbar.register()is called fromWolfMapViewer.add_objectto record a newly createdDrowning_victim_Viewerinstance and update the active reference.
Module Contents
- class wolfhece._drowning_manager.DrowningManager(viewer: wolfhece.PyDraw.WolfMapViewer)[source]
Companion object that owns drowning-victim simulation state.
Instantiated once as
viewer._drowning = DrowningManager(viewer)insideWolfMapViewer.__init__.- mydrownings: list[wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer] = [][source]
- active: Drowning_victim_Viewer | None = None[source]
- register(newobj: wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer) None[source]
Add newobj to the registry and make it the active drowning.
Create and append the ‘Drowning’ menu to the viewer menubar.
Safe to call multiple times — only the first call has any effect.