/// <summary> /// Resumes execution of the associated AI and sets the decision maker state to /// <see cref="F:Crystal.DecisionMakerState.Running" />. /// </summary> public void Resume() { if (State != DecisionMakerState.Paused) { return; } State = DecisionMakerState.Running; OnResume(); }
/// <summary> /// Pauses the associated AI and the decision maker state to /// <see cref="F:Crystal.DecisionMakerState.Paused" />. /// </summary> public void Pause() { if (State != DecisionMakerState.Running) { return; } State = DecisionMakerState.Paused; OnPause(); }
/// <summary> /// Starts the associated AI and sets the decision maker state to /// <see cref="F:Crystal.DecisionMakerState.Running" />. /// </summary> public void Start() { if (State != DecisionMakerState.Stopped) { return; } State = DecisionMakerState.Running; OnStart(); }
/// <summary> /// Stops the associated AI and sets the decision maker state to /// <see cref="F:Crystal.DecisionMakerState.Stopped" />. /// </summary> public void Stop() { if (State == DecisionMakerState.Stopped) { return; } State = DecisionMakerState.Stopped; OnStop(); }
/// <summary> /// Initializes a new instance of the <see cref="DecisionMakerBase"/> class. /// </summary> /// <param name="ai">The ai.</param> /// <param name="contextProvider">The context provider.</param> /// <exception cref="Crystal.DecisionMakerBase.UtilityAiNullException"></exception> /// <exception cref="Crystal.DecisionMakerBase.ContextProviderNullException"></exception> protected DecisionMakerBase(IUtilityAi ai, IContextProvider contextProvider) { if (ai == null) { throw new UtilityAiNullException(); } if (contextProvider == null) { throw new ContextProviderNullException(); } _ai = ai; _contextProvider = contextProvider; State = DecisionMakerState.Stopped; }