Waaaaagh
I lost all my rep and my title being a jerk
- Reaction score
- 70
Just out of curiosity, which of these is faster to get/set values (array set/get, loc set/get)
or a location.
I have a feeling that location is faster, IF you use the methods on the struct for get/set. If you just do it manually, I think structs would be faster.
I have decided that declaring new types is uber fun (expect to see some geometric figures declared using structs).
JASS:
struct coordinate
real x
real y
static method create takes real x, real y returns coordinate
local coordinate c=coordinate.allocate()
set c.x=x
set c.y=y
return c
endmethod
method X takes nothing returns real
return .x
endmethod
method Y takes nothing returns real
return .y
endmethod
method SetX takes real x returns nothing
set .x=x
endmethod
method SetY takes real y returns nothing
set .y=y
endmethod
endstruct
or a location.
I have a feeling that location is faster, IF you use the methods on the struct for get/set. If you just do it manually, I think structs would be faster.
I have decided that declaring new types is uber fun (expect to see some geometric figures declared using structs).