Skip to content

Add World.removeResource#259

Merged
waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:add-world.removeResource
Sep 17, 2025
Merged

Add World.removeResource#259
waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:add-world.removeResource

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

@waynemwashuma waynemwashuma commented Sep 17, 2025

Objective

Introduces the ability to remove resources from the World class, either by their type or TypeId.

Solution

New methods removeResource() and removeResourceByTypeId() have been added to the World. These methods allow resources to be deleted from a world. Unit tests have been added to verify both removal methods and ensure that attempting to access a removed resource throws an error.

Showcase

Here’s how to use the new resource removal methods:

// Create world and add a resource
const world = new World();
world.setResource(new TestResource());

// Remove by type
world.removeResource(TestResource);

world.removeResourceByTypeId(typeid(TestResource));

Migration guide

No breaking changes introduced.

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this Sep 17, 2025
@waynemwashuma waynemwashuma added type:enhancement New feature or request mod:ecs labels Sep 17, 2025
@waynemwashuma waynemwashuma marked this pull request as ready for review September 17, 2025 04:15
@waynemwashuma waynemwashuma merged commit c2d1b7c into wimaengine:dev Sep 17, 2025
5 checks passed
@waynemwashuma waynemwashuma deleted the add-world.removeResource branch September 17, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:ecs type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant