aboutsummaryrefslogtreecommitdiff
path: root/V3/AI/IAiPlayer.cs
diff options
context:
space:
mode:
authorThomas Leyh <leyh.thomas@web.de>2016-07-24 08:14:18 +0200
committerThomas Leyh <leyh.thomas@web.de>2016-07-24 08:14:18 +0200
commitced3d03bdb3ce866d832e03fb212865140905a9a (patch)
tree2a16c2063a46d3c354ce1585029dda3124f6ad93 /V3/AI/IAiPlayer.cs
parent0394dccaf06e1009e591a6ff4d645895574724c1 (diff)
downloadV3-release.tar.gz
V3-release.tar.bz2
Add project files.v1.0release
Diffstat (limited to 'V3/AI/IAiPlayer.cs')
-rw-r--r--V3/AI/IAiPlayer.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/V3/AI/IAiPlayer.cs b/V3/AI/IAiPlayer.cs
new file mode 100644
index 0000000..7f5f81b
--- /dev/null
+++ b/V3/AI/IAiPlayer.cs
@@ -0,0 +1,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();
+ }
+}