DarkBen
New Member
- Joined
- Jan 15, 2010
- Messages
- 299
Ski, what about trying a switch statement instead? It's much faster than nesting a bunch of if statements
Good luck.
I think switch / case won?t work for the number of variables you have to check before casting a spell when you try to give it priorities.
Another thing i can rememeber, but i could be wrong is that compiler optimizes runtime check, meaning if all variables of the IF are AND (&&) it will stop in the first false it encrouter, it it is OR (||) it will stop in the first true it finds and enter the if, so it wont check everything in some cases.
So it?s important to keep most important decision variables first in the checking.
I may be wrong, but thats what i have been told about compiler optimizations since 2001, but i dont know C# compiler very well as it apear to act as a java compiler (Runtime binary translation).
Last edited: