Skip to content

IComponent Interface

A component that can be added to a IScreenObject.

C#
public interface IComponent

Indicates priority to other components.

C#
uint SortOrder { get; }

When true, indicates that this component calls the Update(IScreenObject, TimeSpan) method.

C#
bool IsUpdate { get; }

When true, indicates that this component calls the Render(IScreenObject, TimeSpan) method.

C#
bool IsRender { get; }

When true, indicates that this component calls the ProcessMouse(IScreenObject, MouseScreenObjectState, out bool) method.

C#
bool IsMouse { get; }

When true, indicates that this component calls the ProcessKeyboard(IScreenObject, Keyboard, out bool) method.

C#
bool IsKeyboard { get; }

Called by a host on the update frame.

C#
void Update(IScreenObject host, TimeSpan delta)

host IScreenObject
The host calling the component.

delta TimeSpan
The time that has elapsed from the last call to this component.

Called by a host on the render frame.

C#
void Render(IScreenObject host, TimeSpan delta)

host IScreenObject
The host calling the component.

delta TimeSpan
The time that has elapsed from the last call to this component.

ProcessMouse(IScreenObject, MouseScreenObjectState, out bool)

Section titled “ProcessMouse(IScreenObject, MouseScreenObjectState, out bool)”

Called by a host when the mouse is being processed.

C#
void ProcessMouse(IScreenObject host, MouseScreenObjectState state, out bool handled)

host IScreenObject
The host console.

state MouseScreenObjectState
The mouse state.

handled bool
When set to true informs the host caller that we handled the mouse and to stop others from handling.

ProcessKeyboard(IScreenObject, Keyboard, out bool)

Section titled “ProcessKeyboard(IScreenObject, Keyboard, out bool)”

Called by a host when the keyboard is being processed.

C#
void ProcessKeyboard(IScreenObject host, Keyboard keyboard, out bool handled)

host IScreenObject
The host that added this component.

keyboard Keyboard
The keyboard state.

handled bool
When set to true informs the host caller that we handled the mouse and to stop others from handling.

Called when the component is added to a host.

C#
void OnAdded(IScreenObject host)

host IScreenObject
The host that added the component.

Called when the component is removed from the host.

C#
void OnRemoved(IScreenObject host)

host IScreenObject
The host that removed the component.

Called when various states in the host change.

C#
void OnHostUpdated(IScreenObject host)

host IScreenObject
The host that uses this component.