aboutsummaryrefslogtreecommitdiff
path: root/V3/AI/IAiPlayer.cs
blob: 7f5f81bc854bd941f35bb38c07a90a3d4985e87a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections.Generic;
using Microsoft.Xna.Framework;

namespace V3.AI
{
    /// <summary>
    /// A computer player that takes actions according to a specified strategy.
    /// </summary>
    public interface IAiPlayer
    {
        /// <summary>
        /// The current world view of the player.  It stores the knowledge of
        /// the computer player based on the previous percepts.
        /// </summary>
        IWorldView WorldView { get; }
        /// <summary>
        /// The strategy of the player.  The strategy is a state machine that
        /// defines the current state.
        /// </summary>
        IStrategy Strategy { get; }
        /// <summary>
        /// The current state of the player.  The state is one step of the
        /// strategy, and defines the specific actions to take.
        /// </summary>
        AiState State { get; set; }
        /// <summary>
        /// The actions that the player wants to be executed.  Updated by
        /// Act.
        /// </summary>
        IList<IAction> Actions { get; }

        /// <summary>
        /// Executes one update cycle -- perception, acting and the execution
        /// of actions.
        /// </summary>
        /// <param name="gameTime">the time since the last update</param>
        void Update(GameTime gameTime);

        /// <summary>
        /// Update the AI's view of the game world.
        /// </summary>
        void Percept();

        /// <summary>
        /// Take actions based on the previous percepts, the current strategy
        /// and state.  Updates the list of actions stored in Actions.  These
        /// should be executed by the caller.
        /// </summary>
        void Act();
    }
}