Skip to content

Add object-oriented EntityId methods #725

Open
@marceline-cramer

Description

@marceline-cramer

As game codebases scale, I begin to find this extremely noisy and hard to read:

// e is an EntityId
entity::get_component(e, component());
entity::despawn_recursive(e);
entity::add_child(e, child);

I think that a much more readable (and idiomatic if you're looking at Ambient packages as objects) alternative is this:

// e is an EntityId
e.get(component());
e.despawn_recursive();
e.add_child(child);

This would apply for all other functions on EntityId in the entity module such as has_component().

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttopic:apiAPI functionality, including both host and guest

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions