Comments (2)
Thanks for opening the issue.
Can you share some more info on your use case and what you're trying to achieve?
from ashley.
Hi !
Its for my Gdx game, it use only ashley in render(dt).
I want sometimes to do some code at specific moment in the engine (but just one time !)
My solution was to create an EngineTaskSystem extends EntitySystem with priority 0 (first in my system list)
EngineTaskSystem contains an Array of EngineTask
Engine Task is like
public interface EngineTask {
void doTask();
int priority();
}
So i use EngineTaskSystem to insert new EntitySystem(task.priority()) and override update(dt) to call task.doTask()
and an EngineTaskSystemRemove at last to remove all system created
And when i test i see the problem to modify systems during iteration
Actually my solution was to call my engineTaskSystem.insertTaskInEngine() manually before ashley update for add all my systems in ashley.
and call engineTaskSystem.removeEngineTaskDone() after engine.update().
(EngineTaskSystemRemove is not a system anyway and he is out of ashley)
it work no problem but i like to keep only engine.update in my render()
Anyway i think we need to do a little fix for fix the case of add/remove system during iteration. (why not throw exception)
because actually it do a random behavior because it modified systems array during his iteration.
or this solution :D, perform operation at end of system update loop
Thanks for reading
from ashley.
Related Issues (20)
- GWT build fails HOT 4
- Kotlin coroutine support HOT 2
- Make removed flag of entity accesable HOT 4
- Iterating system updates entities after they have been removed engine HOT 2
- Ashley should not let you add multiple of the same component to an entity HOT 4
- How to avoid unimplemented poolable component? HOT 1
- Unable to access hasComponent method on Entity HOT 2
- how is the compent managed in memory? HOT 1
- Is this project still alive? Thank you. HOT 7
- Different systems with the same family filter receive different entities. HOT 6
- en
- ImGui wiki page not linked in Home HOT 1
- Html is not supported HOT 1
- [Question] Variable assignments at system update method HOT 1
- PooledEntity instances are not reset() if their pool is full
- Removing an entity before it was added leads to unexpected behaviour. HOT 3
- "Getting Started" guide uses deprecated Gradle syntax HOT 1
- Add system with lower priority during iteration HOT 1
- Add a module-info.java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ashley.