Post by Admin on Jul 16, 2016 4:45:37 GMT
Jan Thomä @derkork Dec 18 2015 18:36
What use case is IReactiveExecuteSystem intended for?
Jan Thomä @derkork Dec 18 2015 18:43
Also is there an example on how to make a NoneOf matcher? It seems that Matcher has a method NoneOf but I don't see how you're supposed to call it.
Simon Schmid @sschmid Dec 18 2015 19:19
IReactiveExecuteSystem was part of refactoring when IMultiReactiveSystem was introduced since the normal IReactiveSystem and the IMultiReactiveSystem both share the execute method. Use one either of them but not IReactiveExecuteSystem
Matcher
.AllOf(CoreMatcher.Unit, CoreMatcher.Position)
.NoneOf(CoreMatcher.Destroyed)
Jan Thomä @derkork Dec 18 2015 19:58
Thanks... So this matcher would select all Units with a position that are not destroyed ?
Simon Schmid @sschmid Dec 18 2015 19:58
yes
Jan Thomä @derkork Dec 18 2015 19:59
Neat. Just what I need. Thanks.
Simon Schmid @sschmid Dec 18 2015 20:01
Awesome
Jan Thomä @derkork Dec 18 2015 20:05
I really love the way this works. All code is really short and simple as everything just does one thing.
Jan Thomä @derkork Dec 18 2015 20:31
Hmm property change listeners would actually be useful for the GUI.. E.g. updating the UI every tick will produce a lot of string object allocations which are not really necessary. If I had a property change listener e.g. for the health of a unit, I could update the UI only when a value actually changes.
Simon Schmid @sschmid Dec 18 2015 21:49
that’s already possible
github.com/sschmid/Match-One/blob/master/Assets/Scripts/ScoreLabelController.cs
Updating the score everytime the score changes
What use case is IReactiveExecuteSystem intended for?
Jan Thomä @derkork Dec 18 2015 18:43
Also is there an example on how to make a NoneOf matcher? It seems that Matcher has a method NoneOf but I don't see how you're supposed to call it.
Simon Schmid @sschmid Dec 18 2015 19:19
IReactiveExecuteSystem was part of refactoring when IMultiReactiveSystem was introduced since the normal IReactiveSystem and the IMultiReactiveSystem both share the execute method. Use one either of them but not IReactiveExecuteSystem
Matcher
.AllOf(CoreMatcher.Unit, CoreMatcher.Position)
.NoneOf(CoreMatcher.Destroyed)
Jan Thomä @derkork Dec 18 2015 19:58
Thanks... So this matcher would select all Units with a position that are not destroyed ?
Simon Schmid @sschmid Dec 18 2015 19:58
yes
Jan Thomä @derkork Dec 18 2015 19:59
Neat. Just what I need. Thanks.
Simon Schmid @sschmid Dec 18 2015 20:01
Awesome
Jan Thomä @derkork Dec 18 2015 20:05
I really love the way this works. All code is really short and simple as everything just does one thing.
Jan Thomä @derkork Dec 18 2015 20:31
Hmm property change listeners would actually be useful for the GUI.. E.g. updating the UI every tick will produce a lot of string object allocations which are not really necessary. If I had a property change listener e.g. for the health of a unit, I could update the UI only when a value actually changes.
Simon Schmid @sschmid Dec 18 2015 21:49
that’s already possible
github.com/sschmid/Match-One/blob/master/Assets/Scripts/ScoreLabelController.cs
Updating the score everytime the score changes