Action nodes support and lots of other updates
This commit is contained in:
42
src/gamedata/PlayerActionModule.h
Normal file
42
src/gamedata/PlayerActionModule.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef PLAYERACTIONMODULE_H
|
||||
#define PLAYERACTIONMODULE_H
|
||||
#include <flecs.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <Ogre.h>
|
||||
|
||||
namespace ECS {
|
||||
|
||||
struct ActionNodeList {
|
||||
struct indexObject;
|
||||
struct ActionNode {
|
||||
Ogre::String action;
|
||||
Ogre::String action_text;
|
||||
Ogre::Vector3 position;
|
||||
Ogre::Quaternion rotation;
|
||||
nlohmann::json props;
|
||||
};
|
||||
std::vector<ActionNode> nodes;
|
||||
std::shared_ptr<indexObject> indexObj;
|
||||
bool dirty;
|
||||
void build();
|
||||
bool query(const Ogre::Vector3 &position, std::vector<size_t> &points);
|
||||
int addNode(struct ActionNodeList::ActionNode &node)
|
||||
{
|
||||
int index = nodes.size();
|
||||
nodes.push_back(node);
|
||||
dirty = true;
|
||||
return index;
|
||||
}
|
||||
void removeNode(int index)
|
||||
{
|
||||
nodes.erase(nodes.begin() + index);
|
||||
}
|
||||
};
|
||||
|
||||
struct PlayerActionModule
|
||||
{
|
||||
PlayerActionModule(flecs::world &ecs);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PLAYERACTIONMODULE_H
|
||||
Reference in New Issue
Block a user