Skip to content

IHandleableEvent and ICancelableEvent Interfaces for events to use.#6522

Open
Princess-Cheeseballs wants to merge 3 commits intospace-wizards:masterfrom
Princess-Cheeseballs:event-interfaces
Open

IHandleableEvent and ICancelableEvent Interfaces for events to use.#6522
Princess-Cheeseballs wants to merge 3 commits intospace-wizards:masterfrom
Princess-Cheeseballs:event-interfaces

Conversation

@Princess-Cheeseballs
Copy link
Copy Markdown
Member

Description

Added IHandleableEvent and ICancelableEvent interfaces which are intended to be implemented by events in content and eventually engine to replace the HandleableEntityEventArgs and CancelableEntityEventArgs.

As such those two classes have been marked obsolete

Why?

Some systems in content care about events being handled to cancelled and there's not unified way to handle these events, this poses problems for potential construction system refactors and the like which need to handle a lot of events and check if they've been cancelled/handled/ect. or event relays which often explicitly check for handling/canceling to cut off the relay early.

This is problematic as most new events are by ref structs due to their better performance, and they cannot inherit from these old classes. They can however implement interfaces, hence the need for such interfaces.

This PR only makes these interfaces and marks the old events obsolete as moving engine events to these interfaces would break content pretty badly, we should have at least an engine release or many with these available before we start breaking content by properly getting rid of the old args.

Comment thread Robust.Shared/GameObjects/EntityEvents.cs Outdated
Comment thread Robust.Shared/GameObjects/EntityEvents.cs Outdated
Comment thread Robust.Shared/GameObjects/EntityEvents.cs Outdated
Comment thread Robust.Shared/GameObjects/EntityEvents.cs Outdated
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
@Tayrtahn Tayrtahn self-assigned this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants