Skip to content

ISystem

Martin Evans edited this page Aug 1, 2024 · 1 revision

The most basic type of system inherits from ISystem:

public interface ISystem<in TData>
{
    public void Update(TData data);
}

TData specifies the data that is passed into Update, for example this could be a GameTime struct or something similar.

Init

If a system needs one time setup before the first update call, it should implement ISystemInit:

public interface ISystemInit<in TData>
    : ISystem<TData>
{
    public void Init();
}

Before/After Update

Updates happen every frame, in three phases: BeforeUpdate, Update, AfterUpdate. Systems may implement ISystemBefore and ISystemAfter to participate in the other two phases.

Clone this wiki locally