public Room SetRoom(int x, int y, Room room) { Room tempRoom = null; if ((x >= 0 && x < Width) && (y >= 0 && y < Height)) { if (Rooms[(Width * y) + x] != null) { tempRoom = Rooms[(Width * y) + x]; } Rooms[(Width * y) + x] = room; } return tempRoom; }
public Map(int width, int height) { this.Width = width; this.Height = height; Rooms = new Room[this.Width * this.Height]; }