escapy.events
Event types emitted by commands and consumed by the UI layer.
Every player action or game state change is represented as an immutable event dataclass. Commands return lists of events, and the UI layer reacts to them (e.g. showing a message, switching to code-input mode, or ending the game).
- class escapy.events.PickedUpEvent(object_id)[source]
Bases:
objectAn object was removed from the room and added to the inventory.
- Parameters:
object_id (str)
- class escapy.events.PutInHandEvent(object_id)[source]
Bases:
objectThe player selected an inventory object as the active hand item.
- Parameters:
object_id (str)
- class escapy.events.PutOffHandEvent[source]
Bases:
objectThe player deselected the active hand item (hand is now empty).
- class escapy.events.InteractedWithLockedEvent(object_id)[source]
Bases:
objectThe player tried to interact with a locked object without the right key.
- Parameters:
object_id (str)
- class escapy.events.UnlockedEvent(object_id)[source]
Bases:
objectA locked object was successfully unlocked.
- Parameters:
object_id (str)
- class escapy.events.RevealedEvent(object_id, room_id, position)[source]
Bases:
objectA hidden object was revealed and placed into a room.
- class escapy.events.MovedToRoomEvent(room_id)[source]
Bases:
objectThe active room changed.
- Parameters:
room_id (str)
- class escapy.events.AskedForCodeEvent(object_id)[source]
Bases:
objectThe UI should prompt the player to enter a code.
- Parameters:
object_id (str)
- class escapy.events.InspectedEvent(object_id)[source]
Bases:
objectThe player inspected an object (e.g. zoomed in on it).
- Parameters:
object_id (str)
- class escapy.events.AddedToInventoryEvent(object_id)[source]
Bases:
objectAn object was added to the player’s inventory without being picked up from the room.
- Parameters:
object_id (str)
- type escapy.events.Event = PickedUpEvent | PutInHandEvent | PutOffHandEvent | InteractedWithLockedEvent | UnlockedEvent | RevealedEvent | MovedToRoomEvent | AskedForCodeEvent | WrongCodeEvent | InspectedEvent | GameEndedEvent | AddedToInventoryEvent
Union of all event types that can be emitted during gameplay.