- Joined
- Feb 23, 2008
- Messages
- 587
I am trying to create an array of structs called players.
Also in players I am trying to have in array of structs called tracks.
Each Track will likely have 6-8+ values. And I want to be able to have 1000 tracks per player for 8 players.
I cant seem to get the syntax right, that and I don't fully understand what is allowed.
Any Idea what I am doing wrong, Or whats possible?
I will likely need to extend the size latter on.
Also in players I am trying to have in array of structs called tracks.
Each Track will likely have 6-8+ values. And I want to be able to have 1000 tracks per player for 8 players.
I cant seem to get the syntax right, that and I don't fully understand what is allowed.
Any Idea what I am doing wrong, Or whats possible?
I will likely need to extend the size latter on.
JASS:
function CreatePlayers takes nothing returns nothing
globals
Players myPlayers
endglobals
//How Do I Access Tracks from with in Player??
endfunction
//===========================================================================
scope SetupGame initializer InitA
function InitA takes nothing returns nothing
call CreatePlayers()
endfunction
endscope
JASS:
library MyLibary
struct Tracks extends array
//Variables
private integer x
//You dont have to put public
public integer y
//Defualt values (You cant have a constuctor)
method default takes nothing returns nothing
set this.x = 0
endmethod
//Get
method getX takes nothing returns integer
return this.x
endmethod
//Set
method setX takes integer x returns nothing
set this.x = x
endmethod
//Action
method addFiveToX takes nothing returns nothing
set .x = .x + 5
endmethod
endstruct
struct Players extends array
Tracks tracks
private integer totalTracks
//Get
method getTotalTracks takes nothing returns integer
return this.totalTracks
endmethod
endstruct
endlibrary