Entitas-csharp: Should err when a class implements both IExecuteSystem and IReactiveSystem

Created on 5 Sep 2016  路  6Comments  路  Source: sschmid/Entitas-CSharp

Follow up to: https://twitter.com/entitas_csharp/status/772829525734461440
I think I am ok with the current situation, where if you implement both IReactiveSystem and IExecuteSystem on the same class, the execute won't work.
But I think when you Generate or at least at runtime, there should be an error that says hey don't spend two hours debugging, you've made a mistake.
Also it helps if this is mentioned as a comment in the code or in the docs or something.
Thanks again for Entitas, is not said enough.

feature request on hold

All 6 comments

Hi, I was just looking into this. Technically it's easy to add this. When working with Entitas one of the most important things is order of execution of the systems. If you're system implements both, IReactiveSystem and IExecuteSystem, which execute should be called first? Execute() or Execute(entities). I don't have a general answer to this, so I don't support it atm. But I'm open for discussion.

I think the current implementation makes sense, and keeps things cleaner for testing and when designing. I just didn't know this and thought other may fall into the same trap.
I think it is best if you keep it simple, the way it is. Just prevent people by warning them or something.

About throwing an error:
Entitas is pretty flexible, you're always in control when and which systems to execute. There is actually no downside or limitation to implement both interfaces. You can definitely do that if you know what you're doing.
The way how to create and execute systems are just suggestions from my side.

Yeah true, it's a potential trap. Maybe I should provide more documentation for this

I was thinking of adding some kind of logging support for Entitas, so I save this to my list. I could log a warning or info if you're implementing both

Lovely. I think, from my point of view, I'd rather have a framework that prescribes a certain way of doing things, and when I need to stray from that it also let's me do my thing.
Too much flexibility is prohibitive for beginners, and people with limited development experience, which I'd say are a large percentage of Unity developers. Absolutely no offense meant. You guys are in the top 0.1% of unity developers I believe and shouldn't compare yourself with the actual users of Entitas :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakovd picture jakovd  路  3Comments

JamesMcMahon picture JamesMcMahon  路  5Comments

Stals picture Stals  路  4Comments

CCludts picture CCludts  路  3Comments

zhuchun picture zhuchun  路  4Comments