HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

function interface to static method?

12-16-2008, 12:54 PM#1
rain9441
Possible?

Collapse JASS:
library Asdf

    function interface MyFunctionInterface takes string str returns nothing

    struct MyStruct
        
        static MyFunctionInterface func
 
        static method Hello takes string str returns nothing
            call BJDebugMsg("Hello " + str)
        endmethod
        
        static method onInit takes nothing returns nothing
            // Compile error: Unable to find function MyStruct in the map's script.
            set MyStruct.func = MyFunctionInterface.MyStruct.Hello 
            call MyStruct.func("World")
        endmethod

    endstruct

endlibrary
12-16-2008, 11:59 PM#2
Pyrogasm
I don't see why it wouldn't work...

Did you test it?
12-17-2008, 12:02 AM#3
Vexorian
Impossible, but I plan to add it, it should be easy so maybe next version, but I still don't feel like starting my windows virtual machine...
12-17-2008, 12:09 AM#4
Pyrogasm
I stand corrected then.
12-17-2008, 02:45 PM#5
rain9441
Don't worry about it. Its easier to just make them functions.