public MapObjectCollection(int width, int height) { this.width = width; this.height = height; // alocate memory components = new MapObject[height][]; for (int i = 0; i < height; i++) components[i] = new MapObject[width]; Clear(); }
public void PlaceComponent(int x, int y, MapObject comp) { components[x, y] = comp; }
public void Add(MapObject item, Point pos) { this[pos.X, pos.Y] = item; }