Skip to content

Commit 6b562fa

Browse files
committed
Added class CommandManagerStateEvent.
1 parent f7cac8e commit 6b562fa

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

sc2reader/events/game.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,26 @@ def __init__(self, frame, pid, data):
399399
self.target_data = self.ability_type_data.get("data", None)
400400

401401

402+
@loggable
403+
class CommandManagerStateEvent(GameEvent):
404+
"""
405+
These events indicated that the last :class:`CommandEvent` called has been
406+
called again. For example, if you add three SCVs to an empty queue on a
407+
Command Center, the first add will be generate a :class:`BasicCommandEvent`
408+
and the two subsequent adds will each generate a
409+
:class:`CommandManagerStateEvent`.
410+
"""
411+
412+
def __init__(self, frame, pid, data):
413+
super(CommandManagerStateEvent, self).__init__(frame, pid)
414+
415+
#: Always 1?
416+
self.state = data["state"]
417+
418+
#: An index identifying how many events of this type have been called
419+
self.sequence = data["sequence"]
420+
421+
402422
@loggable
403423
class SelectionEvent(GameEvent):
404424
"""

sc2reader/readers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ def __init__(self):
17451745
self.command_manager_reset_event,
17461746
), # Re-using this old number
17471747
61: (None, self.trigger_hotkey_pressed_event),
1748-
103: (None, self.command_manager_state_event),
1748+
103: (CommandManagerStateEvent, self.command_manager_state_event),
17491749
104: (
17501750
UpdateTargetPointCommandEvent,
17511751
self.command_update_target_point_event,

0 commit comments

Comments
 (0)