From f5c2e09df9bf92c88bef035466716d85c2fa91d4 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 16 Jul 2022 13:00:03 +0200 Subject: [PATCH] Move AiTemporaryBase to a separate header --- apps/openmw/mwmechanics/aicombat.hpp | 1 + apps/openmw/mwmechanics/aifollow.hpp | 1 + apps/openmw/mwmechanics/aistate.hpp | 15 ++------------- apps/openmw/mwmechanics/aitemporarybase.hpp | 19 +++++++++++++++++++ apps/openmw/mwmechanics/aiwander.hpp | 2 +- 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 apps/openmw/mwmechanics/aitemporarybase.hpp diff --git a/apps/openmw/mwmechanics/aicombat.hpp b/apps/openmw/mwmechanics/aicombat.hpp index a51393647c..1d8b8a38b3 100644 --- a/apps/openmw/mwmechanics/aicombat.hpp +++ b/apps/openmw/mwmechanics/aicombat.hpp @@ -2,6 +2,7 @@ #define GAME_MWMECHANICS_AICOMBAT_H #include "typedaipackage.hpp" +#include "aitemporarybase.hpp" #include "../mwworld/cellstore.hpp" // for Doors diff --git a/apps/openmw/mwmechanics/aifollow.hpp b/apps/openmw/mwmechanics/aifollow.hpp index c57d6da483..c1969a7e27 100644 --- a/apps/openmw/mwmechanics/aifollow.hpp +++ b/apps/openmw/mwmechanics/aifollow.hpp @@ -2,6 +2,7 @@ #define GAME_MWMECHANICS_AIFOLLOW_H #include "typedaipackage.hpp" +#include "aitemporarybase.hpp" #include #include diff --git a/apps/openmw/mwmechanics/aistate.hpp b/apps/openmw/mwmechanics/aistate.hpp index 692f731be3..73a054c59e 100644 --- a/apps/openmw/mwmechanics/aistate.hpp +++ b/apps/openmw/mwmechanics/aistate.hpp @@ -1,6 +1,8 @@ #ifndef AISTATE_H #define AISTATE_H +#include "aitemporarybase.hpp" + namespace MWMechanics { @@ -70,19 +72,6 @@ namespace MWMechanics } }; - - /// \brief base class for the temporary storage of AiPackages. - /** - * Each AI package with temporary values needs a AiPackageStorage class - * which is derived from AiTemporaryBase. The Actor holds a container - * AiState where one of these storages can be stored at a time. - * The execute(...) member function takes this container as an argument. - * */ - struct AiTemporaryBase - { - virtual ~AiTemporaryBase(){} - }; - /// \brief Container for AI package status. typedef DerivedClassStorage AiState; } diff --git a/apps/openmw/mwmechanics/aitemporarybase.hpp b/apps/openmw/mwmechanics/aitemporarybase.hpp new file mode 100644 index 0000000000..8ac8e4b71b --- /dev/null +++ b/apps/openmw/mwmechanics/aitemporarybase.hpp @@ -0,0 +1,19 @@ +#ifndef OPENMW_MWMECHANICS_AISTATE_H +#define OPENMW_MWMECHANICS_AISTATE_H + +namespace MWMechanics +{ + /// \brief base class for the temporary storage of AiPackages. + /** + * Each AI package with temporary values needs a AiPackageStorage class + * which is derived from AiTemporaryBase. The Actor holds a container + * AiState where one of these storages can be stored at a time. + * The execute(...) member function takes this container as an argument. + * */ + struct AiTemporaryBase + { + virtual ~AiTemporaryBase() = default; + }; +} + +#endif diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp index 02a1054363..1adb4ed84e 100644 --- a/apps/openmw/mwmechanics/aiwander.hpp +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -7,7 +7,7 @@ #include "pathfinding.hpp" #include "obstacle.hpp" -#include "aistate.hpp" +#include "aitemporarybase.hpp" #include "aitimer.hpp" namespace ESM