Files
ogre-prototype/src/gamedata/CharacterManagerModule.h
2026-01-29 15:28:50 +03:00

43 lines
1.3 KiB
C++

#ifndef _CHARACTER_MANAGER_MODULE_
#define _CHARACTER_MANAGER_MODULE_
#include <flecs.h>
#include <nlohmann/json.hpp>
#include "PlayerActionModule.h"
namespace ECS
{
struct TownCharacterHolder{int index;};
struct TownNPCs {
struct NPCData {
flecs::entity e;
nlohmann::json props;
Ogre::Vector3 position;
Ogre::Quaternion orientation;
Ogre::String model;
std::vector<ActionNodeList::ActionNode> actionNodes;
};
std::map<int, NPCData> npcs;
};
struct LivesIn {};
struct CharacterManagerModule {
std::set<flecs::entity> characters;
flecs::entity player;
CharacterManagerModule(flecs::world &ecs);
flecs::entity createPlayer(const Ogre::Vector3 &position,
const Ogre::Quaternion &rotation);
flecs::entity createCharacterData(const Ogre::String model,
const Ogre::Vector3 &position,
const Ogre::Quaternion &rotation);
void removeCharacterData(int id);
flecs::entity getPlayer() const
{
return player;
}
void registerTownCharacters(flecs::entity town);
void setTownCharacter(flecs::entity town, int index, bool enable);
CharacterManagerModule(CharacterManagerModule &&) = delete;
CharacterManagerModule &operator=(CharacterManagerModule&&) = delete;
};
}
#endif