diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-06-01 02:29:20 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-06-01 02:29:20 -0300 |
| commit | ce3787f190d28c1e981598eef2cd24c622a2cbae (patch) | |
| tree | f4ce0a59533e64e4892d0f0d074be9c7cb166da2 /src/server/game/AI/CreatureAIRegistry.cpp | |
| parent | aeaa8ecfabc2885aa24a86ce22034718cb4f62d8 (diff) | |
Core/AI: Factory functions cleanup
- Get rid of fugly void pointers
- Streamlined AI selection code, using Permissible as it should've been instead of harcoded checks on the selector code
- Moved IdleMovementGenerator singleton to factory code
Diffstat (limited to 'src/server/game/AI/CreatureAIRegistry.cpp')
| -rw-r--r-- | src/server/game/AI/CreatureAIRegistry.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp index 19f27fd23ca..25dcd98c5db 100644 --- a/src/server/game/AI/CreatureAIRegistry.cpp +++ b/src/server/game/AI/CreatureAIRegistry.cpp @@ -23,10 +23,11 @@ #include "PetAI.h" #include "TotemAI.h" #include "RandomMovementGenerator.h" -#include "MovementGeneratorImpl.h" +#include "MovementGenerator.h" #include "CreatureAIRegistry.h" #include "WaypointMovementGenerator.h" #include "CreatureAIFactory.h" +#include "GameObjectAIFactory.h" #include "SmartAI.h" namespace AIRegistry @@ -48,11 +49,13 @@ namespace AIRegistry (new CreatureAIFactory<VehicleAI>("VehicleAI"))->RegisterSelf(); (new CreatureAIFactory<SmartAI>("SmartAI"))->RegisterSelf(); + (new GameObjectAIFactory<NullGameObjectAI>("NullGameObjectAI"))->RegisterSelf(); (new GameObjectAIFactory<GameObjectAI>("GameObjectAI"))->RegisterSelf(); (new GameObjectAIFactory<SmartGameObjectAI>("SmartGameObjectAI"))->RegisterSelf(); - (new MovementGeneratorFactory<RandomMovementGenerator<Creature> >(RANDOM_MOTION_TYPE))->RegisterSelf(); - (new MovementGeneratorFactory<WaypointMovementGenerator<Creature> >(WAYPOINT_MOTION_TYPE))->RegisterSelf(); + (new IdleMovementFactory())->RegisterSelf(); + (new MovementGeneratorFactory<RandomMovementGenerator<Creature>>(RANDOM_MOTION_TYPE))->RegisterSelf(); + (new MovementGeneratorFactory<WaypointMovementGenerator<Creature>>(WAYPOINT_MOTION_TYPE))->RegisterSelf(); } } |
