HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need some struct help, cant think any good title.

09-12-2009, 12:24 PM#1
Viikuna-
This is the problem:

Collapse JASS:
struct door


   method open takes nothing returns nothing
      // opens the door
   endmethod
  
 
endstruct

struct room
    
   door frontdoor
   door backdoor
   
   method someGuyEntersOrLeavesTheRoom takes nothing returns nothing
       /* I need to know when any of those doors are opened;
        I need to know when either frontdoor.open()  or backdoor.open() 
        is called. */
   endmethod

endstruct

I need to do some stuff in that open method that somehow get that someGuyEntersOrLeavesTheRoom thingy called in correct room instance.

Can someone help me with this problem?
09-12-2009, 12:29 PM#2
Eleandor
Add a room member in struct door, so the door knows which room it is part of...
09-12-2009, 12:45 PM#3
Viikuna-
Awesome, I try it, thanks