How to define these data structures on BlitzMax

BlitzMax Forums/BlitzMax Programming/How to define these data structures on BlitzMax

Canali(Posted May) [#1]
Hi,
I'm currently working on the definition of data structures for an Rpg.

I would like to get to something like.

Player[i].X:int
Player[i].Y:int
Player[i].Name:String

Etc...

How can this be done with BlitzMax?


Brucey(Posted May) [#2]
You can use a Type to store your information.

Type TPlayer

    Field X:Int
    Field Y:Int
    Field Name:String

End Type

Local player:TPlayer = New TPlayer
player.Name = "Fred"

Local players:TPlayer[0]
players :+ [player]

... or ...

Local players:TList = New TList
players.AddLast(player)



Canali(Posted May) [#3]
Thanks alot man.
Was quite a fast feedback.