예제 #1
0
 public void AttemptToMove(string direction)
 {
     if (SceneExits.ContainsKey(direction))
     {
         MoveScene(SceneExits[direction], "You head off to " + direction);
     }
     else
     {
         Controller.DisplayText("There is no path to " + direction);
     }
 }
예제 #2
0
        public IResponseAction TryUseItem(string item)
        {
            var actionItem = Sheet.GetItem(item);

            if (actionItem == null)
            {
                return(null);
            }

            var action = actionItem.GetInteraction(ActionEnum.Use);

            if (action?.Response == null)
            {
                return(null);
            }

            controller.DisplayText(action.ResponseDescription);
            return(action.Response);
        }
예제 #3
0
        public IResponseAction TryUseItem(string item, IGameController controller)
        {
            var actionItem = Objects.FirstOrDefault(f => f.Name == item);

            if (actionItem == null)
            {
                return(null);
            }

            var action = actionItem.GetInteraction(ActionEnum.Use);

            if (action?.Response == null)
            {
                return(null);
            }

            controller.DisplayText(action.ResponseDescription);

            return(action.Response);
        }