For a RTS game, I have several characters working around on their own schedule, so they have their own interval. I need to know when they arrive at their destination (when the interval finishes) so that I can make them do whatever task they were going there for in the first place.
So far I’ve used an event to get notified when an interval finishes. Works great, but I cannot tell what interval finished, or more importantly what character it was that triggered the event. Is there a way that I haven’t found so far to put some data to tell my event handler who arrived at its destination?
As an alternative, I’m thinking of maybe just write my own intervals managed by a task, which i don’t suppose would be very hard or long to do.
Any input or trick?