• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] (vJass) Interface Methods + Librarys

Status
Not open for further replies.
Hey all!

I have 2 librarys, and in the first is the interface methods, in the second the call.

I remove unrequired stuff, so its easier to read.

JASS:
library AttackType initializer init requires Table

        function interface initAttack takes attack att returns attack
        
        struct attackType
           integer ID = -1
           initAttack AttackInit = -1

           public static method create takes integer ID, initAttack init returns thistype
                local thistype at = thistype.allocate()
            
                set at.AttackID = ID
                set at.AttackInit = init
                
                return at
            endmethod 
        endstruct
endlibrary

JASS:
library AttackEngine initializer init requires Attack, UnitAttack, AttackType, Table

   public function Instant takes attack att returns attack
        return att
   endfunction

   private function init takes nothing returns nothing
      local attackType at = 0
            set at = attackType.create(ATTACKTYPE_INSTANT, Instant)
            call AttackType_SaveAttackType(at)
   endfunction
endlibrary

Error:
Undeclared Variable: AttackEngine_Instant
 
Status
Not open for further replies.
Top