BWAPI
|
00001 #ifndef STATE_H 00002 #define STATE_H 00003 //------------------------------------------------------------------------ 00004 // Name: State.h 00005 // Desc: abstract base class to define an interface for a state 00006 // Author: Mat Buckland 2002 (fup@ai-junkie.com) 00007 //------------------------------------------------------------------------ 00008 00009 template <class entity_type> 00010 class State 00011 { 00012 public: 00013 00014 virtual ~State(){} 00015 00016 //this will execute when the state is entered 00017 virtual void Enter(entity_type*)=0; 00018 00019 //this is the states normal update function 00020 virtual void Execute(entity_type*)=0; 00021 00022 //this will execute when the state is exited. (My word, isn't 00023 //life full of surprises... ;o)) 00024 virtual void Exit(entity_type*)=0; 00025 00026 virtual char* GetName() { return _name; } 00027 char* _name; 00028 }; 00029 00030 #endif