Beispiel #1
0
        public void Go(string direction)
        {
            string from = _game.CurrentRoom.Name;

            IRoom room = _game.CurrentRoom;

            if (room is ThroneRoom)
            {
                if (_game.CurrentRoom.Move(direction) == _game.CurrentRoom)
                {
                    ThroneRoom thisRoom = (ThroneRoom)room;
                    Messages.Add(thisRoom.TakeThrone(_game.CurrentPlayer.Name));
                }
                else
                {
                    Messages.Add($@"
  The guards storm in and immediately see you are an imposter! They knock you out...
  
    You come to your senses back in the unknown room... once again in a pile of your own vomit");
                    Reset();
                }
                return;
            }
            _game.CurrentRoom = _game.CurrentRoom.Move(direction);
            string to = _game.CurrentRoom.Name;

            if (from == to)
            {
                Messages.Add("Area not available currently");
                return;
            }
            Messages.Add($"Traveled to {to} from {from}");
            Look();
        }