public int getRoomDirection(Door d) { return d.getDirection(); }
/// <summary> /// This method creates a List of Vector2 that represents all the /// doors in the room. /// </summary> private void initDoors() { for (int y = 0; y < ROOM_HEIGHT; y++) { for (int x = 0; x < ROOM_WIDTH; x++) { /* * Old Code if (doorTiles.Contains(roomDesign[x, y])) doorList.Add(new Vector2(x, y)); */ int roomDesign = this.roomDesign[x, y]; if (roomDesign >= DOOR_INDEX_START && roomDesign <= DOOR_INDEX_END) { Rectangle locationOfDoor = new Rectangle(x * 32, y * 32, 32, 32); int directionOfDoor = getDoorDirection(roomDesign); Door newDoor = new Door(locationOfDoor, directionOfDoor); doorList.Add(newDoor); } } } }