• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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