Example #1
0
        public void TransportPlayer(Player player)
        {
            Random r = new Random();

            int    targetRoom = r.Next(1, 21);
            Hazard hazard     = Map.Rooms.ElementAt(targetRoom).Hazard;

            if (hazard == null)
            {
                Console.WriteLine($"Bat has swept you to a room {targetRoom}!");
                Console.ReadKey();
                player.MoveTo(targetRoom);
            }
            else
            {
                TransportPlayer(player);
            }
            // TODO: move the player to another room / check to see that it's not the same room as the current room.
            // Should we consider if a hazard already exists in the room to be dropped off in?
        }