mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Further refinement of new ModularizedTacticalAI architecture; added plans for Crows
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6017 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <map>
|
||||
#include <deque>
|
||||
|
||||
class SOLDIERTYPE;
|
||||
|
||||
namespace AI
|
||||
{
|
||||
namespace tactical
|
||||
@@ -17,23 +19,29 @@ namespace AI
|
||||
// forward declarations
|
||||
class AbstractPlanFactory;
|
||||
class Plan;
|
||||
struct AIInputData;
|
||||
class AIInputData;
|
||||
|
||||
/**@class PlanFactoryLibrary
|
||||
* @brief Singleton. A "library" containing all available PlanFactories, accessible via the strings returned by
|
||||
* their get_name() function.
|
||||
*
|
||||
* Used as one "entry point" for the new AI system within the legacy code (the other being the 'execute()' methods of Plan)
|
||||
* Handles the mapping of a SOLDIERTYPE's bAIIndex to a concrete plan factory instantiation.
|
||||
*/
|
||||
class PlanFactoryLibrary
|
||||
{
|
||||
private:
|
||||
/// Only instance, required for singleton pattern implementation
|
||||
static PlanFactoryLibrary* instance_;
|
||||
/// A mapping of factory names to pointers of said factories
|
||||
std::map<std::string, AbstractPlanFactory*> registred_factories_;
|
||||
/// A mapping of bAIIndex to factory pointers
|
||||
std::deque<AbstractPlanFactory*> ai_index_to_factory_mapping_;
|
||||
PlanFactoryLibrary();
|
||||
public:
|
||||
static PlanFactoryLibrary* instance();
|
||||
Plan* create_plan(size_t index, AIInputData& input) const;
|
||||
Plan* create_plan(size_t index, SOLDIERTYPE* npc, const AIInputData& input) const;
|
||||
void update_plan(size_t intdex, SOLDIERTYPE* npc, const AIInputData& input) const;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user