- Joined
- Dec 1, 2008
- Messages
- 120
Hello.
I'll just go ahead and paste some code here first:
Now when looking at the outcome it's pretty much a disaster, and I'd like to have as little disaster as possible. I read the "The Art of Modulo Interfaces" tutorial by Nestharus, but I just couldn't apply it to my situtation in any way. So, is there a way to write this in some nice and clean way without vJass interfaces? Thanks.
I'll just go ahead and paste some code here first:
JASS:
library Object
interface Object
method onCreate takes nothing returns nothing defaults nothing
endinterface
module ObjectModule
static method create takes nothing returns thistype
local thistype this = allocate()
// do stuff for every Object
static if (thistype.onCreate.exists) then
call .onCreate()
endif
return this
endmethod
endmodule
endlibrary
library ObjType uses Object
struct ObjType extends Object
method onCreate takes nothing returns nothing
// do ObjType specific stuff
endmethod
implement ObjectModule
endstruct
endlibrary
Now when looking at the outcome it's pretty much a disaster, and I'd like to have as little disaster as possible. I read the "The Art of Modulo Interfaces" tutorial by Nestharus, but I just couldn't apply it to my situtation in any way. So, is there a way to write this in some nice and clean way without vJass interfaces? Thanks.