Function Interfaces

wraithseeker

Tired.
Reaction score
122
JASS:
scope test

//imagine this is a system ( does not complie properly .... )

function interface what takes unit target returns nothing

private function test takes nothing returns nothing
       local unit u = GetTriggerUnit()
       call what.execute(u)
       set u = null
endfunction

endscope

// And this is the external function to call the system

scope test

private function abc takes unit target returns nothing
    local what d = what.abc
    call KillUnit(target)
endfunction

endscope


A quick example I wrote, am I doing it right?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
JASS:
scope test

//imagine this is a system ( does not complie properly .... )

function interface what takes unit target returns nothing

private function test takes nothing returns nothing
       local unit u = GetTriggerUnit()
       call what.abc(u)
       set u = null
endfunction

endscope

// And this is the external function to call the system

scope test

private function abc takes unit target returns nothing
    call KillUnit(target)
endfunction

endscope
 

wraithseeker

Tired.
Reaction score
122
Does it work like that?

I don't want to go around touching the system and adding an extra 1 line for every external functions.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top