Git Product home page Git Product logo

tinyecs's Issues

Support Managed Components

It would be helpful if TinyEcs supported managed/non-struct components. While structs are great for performance, there are times where managed components are necessary and its not very ergonomic to wrap every managed component in a Res.

Component Lifecycle Terms

Hey I really like the direction you're taking this library! I've been bouncing between different ECS libs and this seems like a great option.

It would be very helpful if queries had support for defining filters based on the lifecycle of components.

Mainly:

  1. Changed<T> - Evaluates to true when component T was accessed mutably or set for the entity since the last execution of the query

  2. Added<T> - Evaluates to true when component T was added to an entity since the last execution of the query

I'm not fully sure how bevy does this but it seems like they store a vec of watermarks alongside each column that gets updated each time an entry in the column is accessed mutably or added. Then each query tracks a watermark of when it was last ran it uses for comparison.
https://github.com/bevyengine/bevy/blob/main/crates/bevy_ecs/src/change_detection.rs
https://bevy-cheatbook.github.io/programming/change-detection.html

  1. Removed<T> - Evaluates to true when component T was removed from an entity since the last execution of the query

In bevy, removals publish out an event that systems can read if they run the next frame https://github.com/bevyengine/bevy/blob/main/crates/bevy_ecs/src/removal_detection.rs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.