/* name: State.cs * author: sam petro * created: 8 Feb 2007 * last updated: 13 Feb 2007 * * description: the base class for all states which utilize * the FSM. * * note: THIS IS A VIRTUAL CLASS * this must be overloaded for all AI states */ using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using Microsoft.Xna.Framework.Content; using ToolshedGames.InfiniteVelocity.AI; namespace ToolshedGames.InfiniteVelocity.AI { public class State //created 8 feb 2007 { // DECLARE A STATIC INSTANCE AS A MEMBER VAR /// /// all states enter through this function /// put initial state actions here /// immediately transitions to execute /// /// BaseGameEntity child class virtual public void Enter(entity e) { } /// /// this is where the state does most of it's work /// and decides whether or not to transition to the next /// /// BaseGameEntity child class virtual public void Execute(entity e) { } /// /// this is what the AI entity does when exiting this state /// often empty /// /// BaseGameEntity child class virtual public void Exit(entity e) { } //this executes if the entity recieves a message //public bool OnMessage(entity e, ref Telegram msg) { } } }