public void AddAction(string actionName) { if (Scheme?.GetFunctionByName(actionName) == null) { throw new GameException($"Action '{actionName}' not found"); } AvailableActions.Add(actionName); }
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)); }