• 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] what is syntax of struct and case in Jass

Status
Not open for further replies.
Level 40
Joined
Dec 14, 2005
Messages
10,532
There is no case syntax, you have to live with if/then/else(if).

As for structs,

JASS:
struct <name>
    //instance variables
    <type> <name> [= <value>]
    //methods
    [private/public] [static] method <name> takes <paramArgs> returns <value>
    endmethod
endstruct

For example:

JASS:
struct Hi
    integer me = 5
    method m takes nothing returns integer
        return 2*this.me
    endmethod
    real r
endstruct
 
Last edited:
Status
Not open for further replies.
Top