Im creating a tile based game, and have created a map class.
The map class contains an array which holds the tile information and some other stuff.

Map class:

[pascal]
type
TDPMap = class (TObject)
StartX: integer;
StartY: integer;
Map: array[0..MapHeight-1,0..MapWidth-1] of integer;
MapCollision: array[0..MapHeight-1,0..MapWidth-1] of integer;
procedure LoadMap(Map: string; MapClass: array of TDPMap);
procedure SaveMap(MapName: string; MapClass: array of TDPMap);
end;
[/pascal]

When executing the below code, I get an access violation
(Temp is a local integer)

[pascal]
Temp:=Map.map[Y,X];
[/pascal]

So my question is: whats wrong? can't you access arrays within a class like you would with a "ordinary" array?