Structs and Scopes

Charapanga

New Member
Reaction score
46
Hello, and welcome to another one of my problems! Yay me!

Well...I am familiarised with Scopes, privates, private globals etc etc...
But i have no idea what a struct is and what it is used for and how do Static functions differ from Private functions, and how do static variables differ from private variables...
 

Flare

Stops copies me!
Reaction score
662
Try not to think of private variables/functions as completely separate entities to normal variables/functions, you're just making things more confusing

Structs are just a series of global arrays - when you .create a struct, it gives you a new index, which is used as the array index e.g.
JASS:
local StructName data = StructName.create ()
set data.structmember = ...

using structvariable.structmember as the syntax (i.e. var name, dot, member name)

Static methods are methods do not require a struct instance for usage, whereas dynamic methods require a struct instance to be declared so that it can be used. The JASSHelper manual is worth reading over, might be able to explain things in greater detail
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top