public Region(int x, int y, RoomSpec room) { this.x = x; this.y = y; this.Width = room.Tiledata.GetLength(1); this.Height = room.Tiledata.GetLength(0); TileData = room.Tiledata; NPCs = room.NPCs; }
public bool IntersectsRoom(RoomSpec room, int room_x, int room_y) { var x1 = (room_x - this.x + 64) % 64 < this.Width; var x2 = (this.x - room_x + 64) % 64 < room.Width; var y1 = (room_y - this.y + 64) % 64 < this.Height; var y2 = (this.y - room_y + 64) % 64 < room.Height; return((x1 || x2) && (y1 || y2)); }