Exemplo n.º 1
0
        public void UpdateFloor(Player player)
        {
            foreach (Room room in Rooms)
            {
                if (currentRoom != room && room.Intersects(player))
                {
                    currentHallway.Unload();
                    room.Load();
                    currentRoom    = room;
                    currentHallway = null;
                    break;
                }
            }

            foreach (HallWay hallWay in hallways)
            {
                if (currentHallway != hallWay && hallWay.Intersects(player))
                {
                    currentRoom.Unload();
                    hallWay.Load();
                    currentHallway = hallWay;
                    currentRoom    = null;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private bool connectRooms(Room room1, Room room2)
        {
            HallWay hallWay = new HallWay(room1, room2);

            if (!hallWay.Intersects(Rooms))
            {
                hallWay.SetDoors();
                room1.HallWays.Add(hallWay);
                hallways.Add(hallWay);

                return(true);
            }

            return(false);
        }