Skip to content

Implement a fast enough data component.#1105

Open
wuke32767 wants to merge 1 commit intoEverestAPI:devfrom
wuke32767:data-component
Open

Implement a fast enough data component.#1105
wuke32767 wants to merge 1 commit intoEverestAPI:devfrom
wuke32767:data-component

Conversation

@wuke32767
Copy link
Copy Markdown
Contributor

I'm not too glad with the current way to attach fields to an entity. DynamicData.For and Component are both slow (to me).

That's why I made this. Why has no one ever done this before?

Advantage

Fast.

Implementation

Now Entity holds a two-dimensional array. It stores all attached fields.

The first dimension stands for the depth of the entity in the inheritance tree.

Users can register their fields to a type, and the second dimension is the unique index they got.

Any fields are attached to only one type (and it's subtype), it can't work as a universal component.

It handles inheritance by depth dimension. Any child entity will be able to access fields attached to the parent entity, naturally.

Any type safe issue is done by hidding the implementation details.

@maddie480-bot maddie480-bot added the 1: review needed This PR needs 2 approvals to be merged (bot-managed) label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1: review needed This PR needs 2 approvals to be merged (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants