question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Entitas:] Find alternative to pool.CreateSystem()

See original GitHub issue

PoolExtension.cs contains the convenience methods pool(s).CreateSystem()

3 things:

  1. CreateSystem is still the old method name from older versions, where this method actually created a system. It doesn’t anymore, instead we pass in a created system so the name is wrong.
  2. It might sound misleading, because it sounds like the pool ‘owns’ the system (which it doesn’t)
  3. This:
return new Feature("Systems")
            .Add(pools.CreateSystem(new IncrementTickSystem()))
            ...
            .Add(pools.core.CreateSystem(new AddViewSystem()))

Sometimes we use pools.CreateSystem(), sometimes pools.core.CreateSystem(). Would be great to streamline this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
sschmidcommented, Dec 12, 2016

What about sth like this

.Add(new IncrementTickSystem().Bind(pools))
.Add(new AddViewSystem().Bind(pools.core))
.Add(new AddViewSystem().Bind(pools.bullet))

Bind (or a different term? Suggestions?)) actually does the same thing as CreateSystem. If a system implements ISetPoolsthen pass pools in, if it implements ISetPool then pass the pool in, if it doesn’t implement either, do nothing (same behaviour as it is right now).

This might be less confusing and more explicit. Sounds more like we’re using this system with the specified pool

3reactions
sschmidcommented, Dec 14, 2016

It’s the end of the year and a good time to clean up a little bit 😉

I updated IReactiveSystem

    public interface IReactiveSystem : ISystem {
        EntityCollector GetTrigger(Pools pools);
        void Execute(List<Entity> entities);
    }

This change enabled me to get rid of loooots of code . It’s a breaking change but I hope the result is less confusion and less code to maintain.

I deleted:

  • IMultiReactiveSystem
  • TriggerOnEvent
  • IMatcherExtensions
  • .CreateSystem()

… without loosing any features. The new IReactiveSystem can do the same as IMultiReactiveSystem and IEntityCollectorSystem

Adding systems to the list is more streamlined and less code

.Add(new IncrementTickSystem(pools))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Right approach for Unit Testing [Question] · Issue #128
I was wondering, how do i approach Unit Test with Entitas the right way? Are there important things i should pay attention?
Read more >
startkit/Entitas-CSharp
Improved Entitas Event API [Event(bool)] #717 Use "find and replace" to update all ... CreateSystem() not creating a ReactiveSystem for IGroupObserverSystem ...
Read more >
ECS architecture with Unity by example - Unite Europe 2016
Simon Schmid (Wooga) and Maxim Zaks explain how the introduction of strict ECS architecture in Unity helped them to achieve easy to test, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found