Code Monkey home page Code Monkey logo

Comments (6)

mgsx-dev avatar mgsx-dev commented on June 2, 2024 1

@metaphore i'll improve the javadoc, it's a bit confusing indeed :-)

from ashley.

metaphore avatar metaphore commented on June 2, 2024

The example code actually outputs

SystemAttachComponent 1
SystemC 1

I'm not exactly sure how the example should demonstrate the described problem, but I definitely see a mistake in the usage of engine.getEntitiesFor(). From the method's javadoc:

Returns immutable collection of entities for the specified {@link Family}. Will return the same instance every time.

You shouldn't keep the reference to the returned collection, but instead, persist the result using your own instance.

from ashley.

mgsx-dev avatar mgsx-dev commented on June 2, 2024

@metaphore it actually returns the same instance for a given Family filter, it's the typical usage, just like in IteratingSystem.

@ZumiKua and @metaphore which versions are you testing this code against? my guess is it's fixed in master branch.

from ashley.

metaphore avatar metaphore commented on June 2, 2024

@mgsx-dev doh, I should really dig deeper than javadocs haha. Thanks for pointing out.
Hard to tell which commit I'm on, I'm using 1.7.4-SNAPSHOT.

from ashley.

mgsx-dev avatar mgsx-dev commented on June 2, 2024

i can confirm it's fixed, @ZumiKua you can use either 1.7.4-SNAPSHOT or jitpack: "com.github.libgdx:ashley:master-SNAPSHOT"

from ashley.

ZumiKua avatar ZumiKua commented on June 2, 2024

Sorry for my late reply, I'm using 1.7.3, which is bundled with the newest(I guess) gdx-setup.
Maybe gdx-setup needs to be updated?
Anyway, thanks for your help ❤️

from ashley.

Related Issues (20)

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.