View Source Ecspanse.Frame (ECSpanse v0.10.0)

The frame is a struct that encapsulates the state of the current frame.

It holds information such as the time elapsed since the last frame and any batches of events that have been inserted during the previous frame. This frame struct is available to all systems during the frame.

Fields

  • :event_batches - a collection of event batches queued for execution within this frame.
  • :delta - the time elapsed since the last frame in milliseconds.

Summary

Types

t()

The frame struct.

Types

@type t() :: %Ecspanse.Frame{
  delta: non_neg_integer(),
  event_batches: [[event :: struct()]]
}

The frame struct.

Example

  %Ecspanse.Frame{
    event_batches: [[%Demo.Events.MoveHero{direction: :left}, %Demo.Events.FindResource{type: :gold}], [%Demo.Events.MoveHero{direction: :down}]],
    delta: 18,
  }