- Joined
- May 1, 2008
- Messages
- 1,605
Moin moin =)
I don't know any better title for asking what I want, so I hope you'll understand what I mean.
I have 2 vJass libraries for example. The first on is the MapInit library, which initialize all "static variables":
In my second Temp library I wanna use these statics now, so I do:
Okay the thing is in my other libraries I use these statics a lot, so I asked myself which way would be the best and/or the fastes and/or the most effective:
1: I use them as I showed you above.
2: I store them into local variables in the temp library and refer always to the local instead of the static variable
3: I store them into a normal struct variable in the temp library and refer to the struct variable instead of the static one.
Edit: And please if you can, try also to give a reason why you say which is best/faster/most effective, because it's one point to know what, but its another point to know why =D
Greetings - Thanks and Peace
Dr. Boom
I don't know any better title for asking what I want, so I hope you'll understand what I mean.
I have 2 vJass libraries for example. The first on is the MapInit library, which initialize all "static variables":
JASS:
library MapInit initializer init
struct Mapinit
static integer game_integer = 0
static real game_value = 0.
// and so on
In my second Temp library I wanna use these statics now, so I do:
JASS:
library Temp initializer init uses MapInit
static method create takes nothing returns thistype
local thistype this = .allocate()
set MapInit.game_integer = MapInit.game_integer + 1
set MapInit.game_real = MapInit.game_real + 1.337
endmethod
endlibrary
Okay the thing is in my other libraries I use these statics a lot, so I asked myself which way would be the best and/or the fastes and/or the most effective:
1: I use them as I showed you above.
2: I store them into local variables in the temp library and refer always to the local instead of the static variable
3: I store them into a normal struct variable in the temp library and refer to the struct variable instead of the static one.
Edit: And please if you can, try also to give a reason why you say which is best/faster/most effective, because it's one point to know what, but its another point to know why =D
Greetings - Thanks and Peace
Dr. Boom