Giter Site home page Giter Site logo

fullptr / apecs Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 0.0 97 KB

A petite entity component system

License: MIT License

CMake 2.20% C++ 97.80%
cpp cpp20 data-oriented-design ecs ecs-framework entity-component entity-component-system game-development gamedev header-only modern-cpp

apecs's People

Contributors

colinh avatar fullptr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apecs's Issues

Missing reference

Whenever you call the callbacks the code reads

        for (auto cb : std::get<std::vector<callback_t<Comp>>>(d_on_add)) {
            cb(entity, ret);
        }

where probably you'd want to use for( auto& cb : ... in order to not copy the callback object into cb.

Missing variable name

Line 573, which is in member function registry<Comps...>::view(), currently reads

            apx::entity = d_entities[index];

which I needed to change to

            apx::entity entity = d_entities[index];

in order to make it compile (with GCC10).

Missing template keyword

Hi, really like the minimalist approach of apecs!

I just tried compiling with GCC10 and stumbled over the following issue:

In template class handle the type of member field registry depends on the template parameters of handle.

In the member functions of handle that call registry->function<Comp>(...) it is therefore necessary to use the template keyword as in registry->template function<Comp>(...).

Incorrect use of move

In member function registry<Comps...>::add(apx::entity entity, Comp&& component) the argument component is passed on with std::move() even though Comp could be some_component_type&.

Since emplace() does it correctly you probably know that you just need to use std::forward instead, and can then remove the other overload of add(), the one with the const Comp&.

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.