Moderator
M
Moderator
12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.
9th Nov 2011
Bribe: Debug messages should only show in DEBUG_MODE.
Function interfaces are really bad practice for a simple design like this. Do you know that they make copies of the functions being processed? I would prefer "GetEventQuest" "GetEventQuest...Player/NewUnit/OldUnit" which runs off of the Advent system than this setup you have here.
Alternatively, a module to implement the code (like UnitIndexer uses) keeps the user verbosity light and keeps the compiled code light as well.
Polymorphism doesn't work well in structs as those "onDestroy" methods get copies as well. Better to use array structs and make custom "destroy" to avoid such a compiled mess.
Your system combines many different concepts and principles and considers it "one resource". If a user just wants a few aspects of a quest system this would be a horrible choice. Even if a user wanted a more complex system maybe they want it done completely differently from what you have. I have a very strong opinion that your system tries to be more than it is required to be.
I recommend null all handles even players. Some have reported bugs with not nulling players causing leaks in some cases.
Also don't initialize "local player p = Player(0)" when you only reference it once before the loop.
^ These should be at the top in a configurables-section.
The mini-library you named "Array" should just be implemented into your quest system and made a private struct, because it is nowhere near modular enough to take such a dynamic title as "Array", for one there being no "pop" method is a real stinker.
Have a look at RegisterPlayerUnitEvent, it is a really good resource for saving handle count.
IcemanBo: Too long as NeedsFix. Rejected.
9th Nov 2011
Bribe: Debug messages should only show in DEBUG_MODE.
Function interfaces are really bad practice for a simple design like this. Do you know that they make copies of the functions being processed? I would prefer "GetEventQuest" "GetEventQuest...Player/NewUnit/OldUnit" which runs off of the Advent system than this setup you have here.
Alternatively, a module to implement the code (like UnitIndexer uses) keeps the user verbosity light and keeps the compiled code light as well.
Polymorphism doesn't work well in structs as those "onDestroy" methods get copies as well. Better to use array structs and make custom "destroy" to avoid such a compiled mess.
Your system combines many different concepts and principles and considers it "one resource". If a user just wants a few aspects of a quest system this would be a horrible choice. Even if a user wanted a more complex system maybe they want it done completely differently from what you have. I have a very strong opinion that your system tries to be more than it is required to be.
I recommend null all handles even players. Some have reported bugs with not nulling players causing leaks in some cases.
Also don't initialize "local player p = Player(0)" when you only reference it once before the loop.
JASS:
set this.title = "Generic Quest Title"
set this.description = "Generic Quest Description"
^ These should be at the top in a configurables-section.
The mini-library you named "Array" should just be implemented into your quest system and made a private struct, because it is nowhere near modular enough to take such a dynamic title as "Array", for one there being no "pop" method is a real stinker.
Have a look at RegisterPlayerUnitEvent, it is a really good resource for saving handle count.