Beispiel #1
0
 public void AddAction(string actionName)
 {
     if (Scheme?.GetFunctionByName(actionName) == null)
     {
         throw new GameException($"Action '{actionName}' not found");
     }
     AvailableActions.Add(actionName);
 }
Beispiel #2
0
        public int ExecuteAction(string actionName, Object actor, Game game)
        {
            SchemeFunction action = Scheme?.GetFunctionByName(actionName);

            if (action == null)
            {
                throw new GameException("Given action does not exist.");
            }

            return(action.Execute(this, actor, game));
        }