You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The undo function is defined by the following script.
def undo(self, event: Event):
assert event.after_id == 0 or event.before_id == 0
item_id = event.before_id or event.after_id
prev = None
while prev is None or prev.item_id != item_id:
prev = self._events.pop()
if prev.type == "ITEM_PURCHASED":
self.destroy(prev.item_id)
elif prev.type == "ITEM_DESTROYED":
self.add(prev.item_id)
elif prev.type == "ITEM_SOLD":
self.add(prev.item_id)
else:
raise TypeError(f"Unexpected event type {prev.type}")
The event of synthetic an item is down by destroying the previous item first and then purchasing a new item. If an undo event happens to this item, the item will be destroyed directly. However, the correct undo of synthetic is disassembled this item.
The text was updated successfully, but these errors were encountered:
In match.py:
The undo function is defined by the following script.
def undo(self, event: Event):
assert event.after_id == 0 or event.before_id == 0
item_id = event.before_id or event.after_id
prev = None
while prev is None or prev.item_id != item_id:
prev = self._events.pop()
if prev.type == "ITEM_PURCHASED":
self.destroy(prev.item_id)
elif prev.type == "ITEM_DESTROYED":
self.add(prev.item_id)
elif prev.type == "ITEM_SOLD":
self.add(prev.item_id)
else:
raise TypeError(f"Unexpected event type {prev.type}")
The event of synthetic an item is down by destroying the previous item first and then purchasing a new item. If an undo event happens to this item, the item will be destroyed directly. However, the correct undo of synthetic is disassembled this item.
The text was updated successfully, but these errors were encountered: