I love this course, but I’m started to get a little bit confused with all the delegates and events, especially with so many parts of the code being every so slightly different. It got me thinking of ways to drive some consistency to make it easier to understand the flow of the code. As I’m not an engineer professionally, simplicity is absolutely key for me.
Ok so here’s my idea:
Since we already have OnAnyActionCompleted?.Invoke(…) inside of BaseAction ActionComplete would it be OK to remove the onActionComplete callback and instead have UnitActionManger and Enemy AI subscribe to the OnAnyActionCompleted event? The only nuance I see is each of those subscribers would have to parse the event to see if it came from either a player or enemy action being completed. UnitActionSystem should ignore Enemy events and EnemyAI should ignore Player events. The rest of it would seem to work.
Want to make sure I’m not seeing any big concerns. I imagine the reason we did both EventHandlers and callbacks is because this is a teaching course. I heard Hugo many times emphasize this is a teaching course and he wants to introduce us to many different ways of doing things.
I’m getting all the concepts individually and I love learning everything but I’m worried I won’t be able to make progress on my own games without reducing the “variety” when it comes to my own creations.