openmw-tes3coop/components/openmw-mp/Base/WorldEvent.hpp

90 lines
1.6 KiB
C++
Raw Normal View History

#ifndef OPENMW_WORLDEVENT_HPP
#define OPENMW_WORLDEVENT_HPP
2016-10-22 17:15:32 +00:00
#include <components/esm/loadcell.hpp>
2016-10-20 19:15:47 +00:00
#include <components/esm/cellref.hpp>
#include <RakNetTypes.h>
namespace mwmp
{
struct WorldObject
{
std::string refId;
int refNumIndex;
int goldValue;
int count;
ESM::Position pos;
2016-11-21 21:40:50 +00:00
int state;
2016-10-24 10:20:04 +00:00
int lockLevel;
float scale;
2016-10-24 14:52:19 +00:00
2016-11-20 20:54:49 +00:00
std::string filename;
2016-10-24 14:52:19 +00:00
bool allowSkipping;
2016-10-27 13:09:02 +00:00
std::string animGroup;
int animMode;
int index;
int shortVal;
float floatVal;
std::string varName;
};
struct ContainerItem
{
std::string refId;
int count;
int health;
inline bool operator==(const ContainerItem& rhs)
{
return refId == rhs.refId && count == rhs.count && health == rhs.health;
}
};
struct ObjectChanges
{
std::vector<WorldObject> objects;
unsigned int count;
};
struct ContainerChanges
{
std::vector<ContainerItem> items;
unsigned int count;
enum CONTAINER_ACTION
{
SET = 0,
ADD = 1,
REMOVE = 2
};
int action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item
};
class WorldEvent
{
public:
WorldEvent(RakNet::RakNetGUID guid) : guid(guid)
{
}
WorldEvent()
{
}
RakNet::RakNetGUID guid;
ObjectChanges objectChanges;
ContainerChanges containerChanges;
ESM::Cell cell;
};
}
#endif //OPENMW_WORLDEVENT_HPP