A class in Root.Township, ATT.MicroTutorial.
Server: records the tutorial player's events for each step so a step can see events that happened before it started. Created by ServerStepInstance.
Constructors
Fields
4 private and internal fields
| Member | What it is |
|---|
private readonly List<IPlayerEvent>[] eventBuffer | One list of buffered events per tutorial step. |
private readonly IEventBus eventBus | Event bus the buffer listens on. |
private Action<IPlayerEvent> passthroughHandler | Handler set by SwitchToPassthrough. When set, events skip the buffer. |
private readonly IServerStepInstance step | The server step instance this buffer belongs to. |
Methods
| Member | What it is |
|---|
IEnumerable<IPlayerEvent> SwitchToPassthrough(Action<IPlayerEvent> passthroughHandler) | Sends future events straight to the handler and returns buffered events from the current step back PlayerEventSearchDepth steps (all steps if negative). |
2 private and internal methods
| Member | What it is |
|---|
private void OnPlayerEvent(IPlayerEvent playerEvent) | Handles an event from the tutorial's player: passes it through if a handler is set, otherwise buffers it under the current step. |
private void OnStepCompleted(IServerStepInstance _) | Stops listening for the step's required event types once the step completes. |
Used in
Members of other types that take, return or hold a PlayerEventBuffer: