Esempio n. 1
0
        public void EnterNewRoom(string input)
        {
            string text = input;

            string[] inputs = text.Split(' ');
            var      query1 = inputs.Where(i => i == "FORWARD" || i == "BACKWARD")
                              .Select(i => i).ToList();

            var query = PresentLocation.ListOfDoors.Where(d => d.Direction == query1[0])
                        .Select(d => d).ToList();

            PresentLocation = query[0].LeadsTo;

            if (PresentLocation.GameOver == true)
            {
                Console.WriteLine(query[0].LeadsTo.RoomName);
                Console.WriteLine(PresentLocation.RoomDescription);
                Alive = false;
            }
            else
            {
                PresentLocation.PrintDescription(PresentLocation);
            }
        }
Esempio n. 2
0
 public void Look(string input)
 {
     PresentLocation.PrintDescription(PresentLocation); //skriver ut rummets beskrivning och föremål
     PrintPlayerBag(PresentLocation);
 }