• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

struct extends array

Status
Not open for further replies.
Level 12
Joined
Oct 16, 2010
Messages
680
I read a lot about this and i kinda like it , but i have a couple of question because I'm still new in this.

Can i still extend interfaces? if yes tell me how i don't found anything:S
if no what can i do instead of interfaces?

does that I cant give default values to variables means i have to "set" them manually after declaration? Cos i got this compile error

whats the difference between create and allocate? if theres any
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
A struct that extends an array has nothing in it but the syntax, so you have to code everything you want from scratch. This means that allocate is just a method, just like create. However, by vjass standards, we say that allocate will allocate a new instance and that create sets that instance up. A lot of resources just inline the allocate into create.


Interfaces are never used in pro resources. Pro resources either use events or modules.
 
Level 12
Joined
Oct 16, 2010
Messages
680
i saw how to make modules, but i have a question about

so e.g.

JASS:
module modulename
     method something takes nothing returns nothing
           //script a
     endmethod
endmodule

JASS:
struct name
implement modulename

     method something takes nothing returns nothing
           //script b
     endmethod

script a and b will be added together and not overwriting each other right?
by the way how do u work with events?

and what u said means if i want to make a linked list for the struct array
i should use allocate?
or by vjass standards u mean that "create is for setup" is a common thing
 
Last edited:
Status
Not open for further replies.
Top