Abstract Event class¶
-
class
Event.Event(level)[source]¶ Generic Event object all specific Events inherit from.
- Parameters
level (Level) – The Level this Event will be used on.
-
set_session(session)[source]¶ Sets the Session the event will be triggered in.
- Parameters
session (Session) – The session this Event will be triggered in.
-
abstract property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Specific Events¶
Teleportation¶
-
class
Event.Teleport(level, target_position)[source]¶ Bases:
Event.EventTeleports to a set location
- Parameters
level (Level) – The Level this Event will be used on.
target_position (int) – The target of the teleportation.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Random Teleportation¶
-
class
Event.RandomTeleport(level, list_of_target_zones)[source]¶ Bases:
Event.EventTeleports to a type of zone that is on the given list randomly.
- Parameters
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Port On/Off¶
-
class
Event.PortOn(level, port)[source]¶ Bases:
Event.EventTurns on a port on the Level’s Gramophone.
- Parameters
level (Level) – The Level this Event will be used on.
port (int) – Which output to use on the device.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
-
class
Event.PortOff(level, port)[source]¶ Bases:
Event.EventTurns off a port on the Level’s Gramophone.
- Parameters
level (Level) – The Level this Event will be used on.
port (str -- 'A', 'B' or 'C') – Which output should be turned off.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Starting/Stopping bursting¶
-
class
Event.StartBurst(level, port, on_time, pause_time)[source]¶ Bases:
Event.EventStarts bursting a port on the Level’s gramophone.
- Parameters
level (Level) – The Level this Event will be used on.
port (int) – Which output to use on the device.
on_time (float) – How long should the port by set to high before a pause.
pause_time (float) – How long should the pauses be.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
-
class
Event.StopBurst(level, port)[source]¶ Bases:
Event.EventStops bursting a port on the Level’s gramophone.
- Parameters
level (Level) – The Level this Event will be used on.
port (int) – Which output should stop bursting.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Pausing/Unpausing¶
-
class
Event.Pause(level, pause_position=None)[source]¶ Bases:
Event.EventPauses the Level where it is or at a given position.
- Parameters
level (Level) – The Level this Event will be used on.
pause_position (int or None) – Set to None to pause at current position. None by default.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
-
class
Event.UnPause(level, unpause_position=None)[source]¶ Bases:
Event.EventUnpauses the Level where it is or at a given position.
- Parameters
level (Level) – The Level this Event will be used on.
unpause_position (int or None) – Set to None to pause at current position. None by default.
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.
Printing messages¶
-
class
Event.Print(level, message)[source]¶ Bases:
Event.EventPrints the given message to the console window.
- Parameters
message (str) – The message that will be printed when triggered
-
property
triggerable¶ Tell whether it makes sense to trigger this event at the moment.