diff --git a/hcore/include/director/commandList.h b/hcore/include/director/commandList.h new file mode 100644 index 0000000..922f0b8 --- /dev/null +++ b/hcore/include/director/commandList.h @@ -0,0 +1,72 @@ +#ifndef DIRECTOR_COMMANDLIST_H +#define DIRECTOR_COMMANDLIST_H + +#include +#include +#include + +namespace director { + +/** + * @brief Base class for all commands, storing a reference to a mental entity ID. + * + * Derived classes can extend this to include additional command-specific + * data and behavior. + */ +class Command +{ +public: + Command(const MentalEntity::Id menty) : menty(menty) {} + +public: + const MentalEntity::Id menty; +}; + +class CommandList +{ +public: + CommandList() = default; + + /** + * @brief Used by Director to point to the currently executing command. + * + * director::Director maintains an internal cursor. As it executes commands + * from its internal command list, it advances the cursor to the current + * command before executing it. + */ + class Cursor + { + public: + Cursor(CommandList& commandList) + : commandList(commandList), iter(commandList.commands.begin()) + {} + + void reset() { iter = commandList.commands.begin(); } + bool hasNext() const { return iter != commandList.commands.end(); } + Cursor next() { return Cursor(commandList, ++iter); } + + private: + Cursor( + CommandList& commandList, + std::vector::iterator iter) + : commandList(commandList), iter(iter) + {} + + public: + CommandList& commandList; + std::vector::iterator iter; + }; + + Cursor getCursor() { return Cursor(*this); } + void addCommand(const Command& command) + { + commands.push_back(command); + } + +public: + std::vector commands; +}; + +} // namespace director + +#endif // DIRECTOR_COMMANDLIST_H diff --git a/hcore/include/director/director.h b/hcore/include/director/director.h new file mode 100644 index 0000000..89c9462 --- /dev/null +++ b/hcore/include/director/director.h @@ -0,0 +1,14 @@ +#ifndef DIRECTOR_H +#define DIRECTOR_H + +namespace director { + +class Director { +public: + Director() = default; + ~Director() = default; +}; + +} // namespace director + +#endif // DIRECTOR_H diff --git a/hcore/include/goal.h b/hcore/include/goal.h index 96a6789..08aef07 100644 --- a/hcore/include/goal.h +++ b/hcore/include/goal.h @@ -1,13 +1,17 @@ #ifndef _GOAL_H #define _GOAL_H -namespace thought { +#include -enum class Goal -{ - DRIFT, - ASSOCIATE_CAUSAL_QUALE_WITH_INTRINSIC_MOTIVATORS, - RESPOND_TO_CAUSAL_QUALE +namespace hk { + +class Goal { +public: + Goal(const simulator::Scene& scene) : scene(scene) {} + ~Goal() = default; + +private: + simulator::Scene scene; }; } diff --git a/hcore/include/simulator/commandList.h b/hcore/include/simulator/commandList.h index 4c044d6..fa8de1c 100644 --- a/hcore/include/simulator/commandList.h +++ b/hcore/include/simulator/commandList.h @@ -5,7 +5,7 @@ #include #include -namespace scene { +namespace simulator { /** * @brief Base class for all commands, storing a reference to a mental entity ID. @@ -30,9 +30,9 @@ public: /** * @brief Used by Scene to point to the currently executing command. * - * scene::Scene maintains an internal cursor. As it executes commands from - * its internal command list, it advances the cursor to the current command - * before executing it. + * simulator::Scene maintains an internal cursor. As it executes commands + * from its internal command list, it advances the cursor to the current + * command before executing it. */ class Cursor { @@ -67,6 +67,6 @@ public: std::vector commands; }; -} // namespace scene +} // namespace simulator #endif // SIMULATOR_COMMANDLIST_H diff --git a/hcore/include/simulator/scene.h b/hcore/include/simulator/scene.h index e14dd6c..9f4e79f 100644 --- a/hcore/include/simulator/scene.h +++ b/hcore/include/simulator/scene.h @@ -6,7 +6,7 @@ #include #include -namespace scene { +namespace simulator { class Scene { diff --git a/hcore/include/simulator/simulator.h b/hcore/include/simulator/simulator.h index b02ed01..9e4ac8b 100644 --- a/hcore/include/simulator/simulator.h +++ b/hcore/include/simulator/simulator.h @@ -7,24 +7,15 @@ namespace simulator { class Simulator { public: - Simulator(const Simulator&) = delete; - void operator=(const Simulator&) = delete; - - static Simulator& instance() - { - static Simulator instance; - return instance; - } - - void initialize(); - void loadScene(scene::Scene::Id sceneId, scene::Scene &scene); - -private: Simulator() = default; ~Simulator() = default; - scene::Scene::Id sceneId; - scene::Scene scene; + void initialize(); + void loadScene(Scene::Id sceneId, Scene &scene); + +private: + Scene::Id sceneId; + Scene scene; }; }