I removed the slide system ;P
I implemented it a very long time ago before I knew using interfaces and shit like that creates a lot of script.
I had many spells that used structs extending the slide struct =P
I replaced it with a simple knockback system that I wrote myself ^.^
Dirac think about two targets just shooting at each other, or a battle going on with multiple units. Maybe if you only play DotA where people are kiting all day you might have this idea about targets moving 90% of the time, but that is really a misconception. Targets are very often standing still, and in my experience it's more about 70-80% of the time the target is not moving. I had been playing this game since about 3 months after the release of RoC.
Some things, like the arc/gravity of a missile, can be precalculated just once, especially for non-homing missiles.
For colliding missiles, you should have a method named "onCollide" if the user wants it. And instead of calling "onImpact" you would call "onCollide" for people who don't want collision support in their structs you can have a "static if thistype.onCollide.exists" for that entire collision block.
I understand the function but I don't understand why something like "clearNode" or the "prev" operator has to be generated when I don't want it. Well that's why I code my own stuff, because you want a modular thing and I want a lightweight thing.
I recommend you make the "head" member public then. And make all the members public as well. It makes sense because of the way you're treating things, and it will help cut down on the verbosity of the code.
You forgot onInit, and all your method operators. Yes they inline but Vexorian's optimizer doesn't always remove inlined functions which sux.
Your naming convention is weird. The name "Node" should represent a node within a list, but you use it to represent the list itself.
Does .flushNode destroy the head node? It looks like it does, because you set .head to false. If it does, its name should be back to the original deleteList.
In your Advent mockup you don't use .clearNode, so that is one useless method.
The LinkedList which I wrote would also work great for Advent. Two methods and two method operators, and no unwanted features.
Your "create" method should define whether it is a node or a list that is being created. Your "destroy" method should also work whether it's a list or whether it's a node. These changes will help you cut back on overhead functions.
Then I have to do trigger recycling which takes up a lot of handles in inventory :/
I think using ExecuteFunc is the best way to handle it overall. Just with a disclaimer they can't use concatenation if they use the optimizer. Frotty needs to release his system soon so we don't have to do this madness!
ExecuteFunc doesn't use any handles, which is 100% awesome.
I suppose it could take code but then you'd be dealing with either:
1. Hashtable lookups to remember the triggers via the boolexpr that remembers the code value (which is doable but I think adds an unnecessary overhead)
2. Adding/removing conditions dynamically which is way sucky on performance.
Either way is worse than just using a module to initialize a trigger once, like this:
private static method onHitProxy takes nothing returns nothing
private static method onInit takes nothing returns nothing
static if thistype.onHit.exists then
local trigger t = CreateTrigger()
call PreRegTrig(t, function thistype.onHitProxy)
set t = null
It's too bad "code array" does not compile. That would make this whole thing WAY easier.
I was using ExecuteFunc but when I wrote it, it was in vanilla JASS where you don't have to worry about private prefixes. The vJass one would end up having to use a module where I initialize a certain function to a trigger, just to avoid function interfaces.
Dirac it looks pretty good however it can be simplified, for example you don't need an "Asin" every loop.
I will upload my missile library to pastbin later so you can see what I've got. I think my code is a little bit longer, maybe because it supports more stuff like "onImpact", but it's the most lightweight missile system I could make because everything else was too much for my crappy CPU.
I was reading a few articles on Quantum Theory and totally understood everything ;o
Or did I!?! According to Quantum Mechanics, I did and didn't :ogre_hurrhurr:
And in some other universe, I got hit by a giant pickle while reading the article, and I'm in the hospital -> But at that point, the universe branches to satisfy all the possibilities: - Ambulance crashed and did not crash
- Giant pickle hit ambulance and did not
- Ambulance hit giant pickle and did not
You can do as you'd like. I don't mind having competition or anything, and mine is more of an extension of Nes's Damage System so I think you'd actually have more feedback/competition from Nestharus than me.