Hello. Thanks for reviewing.
Nulling player variable is not needed, but doing so is also fine. You need to null other types of agents because they can be destroyed. If an agent is destroyed and a local variable is still referencing to it, there will happen so called
reference leak: the variable is referencing to an object but that object and variable are no longer accessible in any way. It's super minor but the leak will stay there until the game ends. Meanwhile, a player will never be
destroyed. So reference leak won't happen in this case.
The point of using private keyword is to make the struct (members) inaccessible for other libraries/scopes/structs. Using private struct is very useful for restricting other libraries/scopes to access that struct, but the other structs inside the same library/scope can use/access its members freely. As long as the user (or other libraries/scopes) can not access the struct at all, I think it's totally fine not to privatize its members. I have always done this thing for long actually.
The only way this.sfx
will ever be null is if you set it to null. Seems like a useless check to me
The stun struct is also used to pause/stun the caster, without special effect. But yeah, it's kind of nerdy optimization.
I would add an extra note..
They can ask me directly if they want to modify the spell. But I doubt it will ever happen.