• 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.

[vJASS] Interface questions

Status
Not open for further replies.
Level 11
Joined
Apr 6, 2008
Messages
760
Hi, i have a question about interfaces first time im working with them and i realised one thing.

look here

JASS:
interface Interfaces

real HP

endinterface

JASS:
struct SomeSystem

Interfaces F

    static method create takes Interfaces F returns thistype
        local thistype this = thistype.allocate()

        set this.F = F
  
        return this
    endmethod
    

    static method callback takes nothing returns nothing
        //Stuff to get the correct Struct instance

        set this.F.HP = this.F.HP - 1 //What will happen if the Spell dont have the real HP?

        if this.F.HP <= 0 then //What will happen here?
        else
        endif
endstruct

JASS:
struct SomeSpell extends Interfaces

SomeSystem SS

    static method create takes nothing returns thistype
        local thistype this = thistype.allocate()

        set this.SS = SomeSystem.create(this)
  
        return this
    endmethod

endstruct

So as you can see in the spell there is no real 'HP', what will happen when i try to mix with that in the system (Check the callback function)?
 
Status
Not open for further replies.
Top