diff --git a/corelogic/include/scene.h b/corelogic/include/scene.h deleted file mode 100644 index 6691dc8..0000000 --- a/corelogic/include/scene.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _SCENE_H -#define _SCENE_H - -class Scene -{ -}; - -#endif - diff --git a/corelogic/Makefile.am b/hcore/Makefile.am similarity index 100% rename from corelogic/Makefile.am rename to hcore/Makefile.am diff --git a/corelogic/include/association.h b/hcore/include/association.h similarity index 100% rename from corelogic/include/association.h rename to hcore/include/association.h diff --git a/corelogic/include/attentionGrabber.h b/hcore/include/attentionGrabber.h similarity index 100% rename from corelogic/include/attentionGrabber.h rename to hcore/include/attentionGrabber.h diff --git a/corelogic/include/attentionTrigger.h b/hcore/include/attentionTrigger.h similarity index 100% rename from corelogic/include/attentionTrigger.h rename to hcore/include/attentionTrigger.h diff --git a/corelogic/include/body/bodyMap.h b/hcore/include/body/bodyMap.h similarity index 100% rename from corelogic/include/body/bodyMap.h rename to hcore/include/body/bodyMap.h diff --git a/corelogic/include/body/bodyMessage.h b/hcore/include/body/bodyMessage.h similarity index 100% rename from corelogic/include/body/bodyMessage.h rename to hcore/include/body/bodyMessage.h diff --git a/corelogic/include/body/bodyPart.h b/hcore/include/body/bodyPart.h similarity index 100% rename from corelogic/include/body/bodyPart.h rename to hcore/include/body/bodyPart.h diff --git a/corelogic/include/body/limb.h b/hcore/include/body/limb.h similarity index 100% rename from corelogic/include/body/limb.h rename to hcore/include/body/limb.h diff --git a/corelogic/include/chronomenon.h b/hcore/include/chronomenon.h similarity index 100% rename from corelogic/include/chronomenon.h rename to hcore/include/chronomenon.h diff --git a/corelogic/include/concept.h b/hcore/include/concept.h similarity index 100% rename from corelogic/include/concept.h rename to hcore/include/concept.h diff --git a/corelogic/include/existent.h b/hcore/include/existent.h similarity index 100% rename from corelogic/include/existent.h rename to hcore/include/existent.h diff --git a/corelogic/include/goal.h b/hcore/include/goal.h similarity index 100% rename from corelogic/include/goal.h rename to hcore/include/goal.h diff --git a/corelogic/include/mentalEntity.h b/hcore/include/mentalEntity.h similarity index 100% rename from corelogic/include/mentalEntity.h rename to hcore/include/mentalEntity.h diff --git a/corelogic/include/mind.h b/hcore/include/mind.h similarity index 100% rename from corelogic/include/mind.h rename to hcore/include/mind.h diff --git a/corelogic/include/nonNeutralQualia.h b/hcore/include/nonNeutralQualia.h similarity index 100% rename from corelogic/include/nonNeutralQualia.h rename to hcore/include/nonNeutralQualia.h diff --git a/corelogic/include/quale.h b/hcore/include/quale.h similarity index 100% rename from corelogic/include/quale.h rename to hcore/include/quale.h diff --git a/corelogic/include/qualeBundle.h b/hcore/include/qualeBundle.h similarity index 100% rename from corelogic/include/qualeBundle.h rename to hcore/include/qualeBundle.h diff --git a/corelogic/include/sensors/interoceptor.h b/hcore/include/sensors/interoceptor.h similarity index 100% rename from corelogic/include/sensors/interoceptor.h rename to hcore/include/sensors/interoceptor.h diff --git a/hcore/include/simulator/canvas.h b/hcore/include/simulator/canvas.h new file mode 100644 index 0000000..fdafa1e --- /dev/null +++ b/hcore/include/simulator/canvas.h @@ -0,0 +1,21 @@ +#ifndef CANVAS_H +#define CANVAS_H + +#include + +namespace canvas { + +class Canvas { +public: + Canvas(); + ~Canvas(); + + SceneId loadScene(Scene &scene); + +private: + // Add private members here +}; + +} // namespace canvas + +#endif // CANVAS_H \ No newline at end of file diff --git a/hcore/include/simulator/commandList.h b/hcore/include/simulator/commandList.h new file mode 100644 index 0000000..4c044d6 --- /dev/null +++ b/hcore/include/simulator/commandList.h @@ -0,0 +1,72 @@ +#ifndef SIMULATOR_COMMANDLIST_H +#define SIMULATOR_COMMANDLIST_H + +#include +#include +#include + +namespace scene { + +/** + * @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 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. + */ + 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 scene + +#endif // SIMULATOR_COMMANDLIST_H diff --git a/hcore/include/simulator/scene.h b/hcore/include/simulator/scene.h new file mode 100644 index 0000000..e14dd6c --- /dev/null +++ b/hcore/include/simulator/scene.h @@ -0,0 +1,36 @@ +#ifndef _SCENE_H +#define _SCENE_H + +#include +#include +#include +#include + +namespace scene { + +class Scene +{ +public: + using Id = uint32_t; + + Scene(); + ~Scene(); + + bool hasMentalEntity(const MentalEntity::Id menty) const; + MentalEntity::Id addMentalEntity(const MentalEntity& menty); + void replaceMentalEntity(const MentalEntity::Id menty, const MentalEntity& newMenty); + void removeMentalEntity(const MentalEntity::Id menty); + + void executeInd(void); + CommandList::Cursor haltInd(void); + +private: + std::map menties; + CommandList commands; + CommandList::Cursor cursor; +}; + +} + +#endif + diff --git a/hcore/include/simulator/simulator.h b/hcore/include/simulator/simulator.h new file mode 100644 index 0000000..e24a81f --- /dev/null +++ b/hcore/include/simulator/simulator.h @@ -0,0 +1,24 @@ +#ifndef SIMULATOR_H +#define SIMULATOR_H + +#include + +namespace simulator { + +class Simulator { +public: + Simulator(); + ~Simulator(); + + void initialize(); + void run(); + void stop(); + +private: + bool isRunning; + Canvas canvas; +}; + +} + +#endif // SIMULATOR_H \ No newline at end of file diff --git a/corelogic/include/stupefier.h b/hcore/include/stupefier.h similarity index 100% rename from corelogic/include/stupefier.h rename to hcore/include/stupefier.h diff --git a/corelogic/include/subconscious.h b/hcore/include/subconscious.h similarity index 100% rename from corelogic/include/subconscious.h rename to hcore/include/subconscious.h diff --git a/corelogic/include/thought.h b/hcore/include/thought.h similarity index 100% rename from corelogic/include/thought.h rename to hcore/include/thought.h diff --git a/corelogic/include/thoughtContentSource.h b/hcore/include/thoughtContentSource.h similarity index 100% rename from corelogic/include/thoughtContentSource.h rename to hcore/include/thoughtContentSource.h diff --git a/corelogic/include/valueJdgmnt.h b/hcore/include/valueJdgmnt.h similarity index 100% rename from corelogic/include/valueJdgmnt.h rename to hcore/include/valueJdgmnt.h diff --git a/corelogic/mind.cpp b/hcore/mind.cpp similarity index 100% rename from corelogic/mind.cpp rename to hcore/mind.cpp diff --git a/corelogic/painfulQuale.cpp b/hcore/painfulQuale.cpp similarity index 100% rename from corelogic/painfulQuale.cpp rename to hcore/painfulQuale.cpp