1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/components/openmw-mp/Base/BaseEvent.hpp
2017-04-09 10:50:35 +03:00

110 lines
2 KiB
C++

#ifndef OPENMW_BASEEVENT_HPP
#define OPENMW_BASEEVENT_HPP
#include <components/esm/loadcell.hpp>
#include <components/openmw-mp/Base/BaseStructs.hpp>
#include <RakNetTypes.h>
namespace mwmp
{
struct ContainerItem
{
std::string refId;
int count;
int charge;
int actionCount;
inline bool operator==(const ContainerItem& rhs)
{
return refId == rhs.refId && count == rhs.count && charge == rhs.charge;
}
};
struct ContainerChanges
{
std::vector<ContainerItem> items;
unsigned int count;
};
struct WorldObject
{
std::string refId;
int refNumIndex;
int mpNum;
int count;
int charge;
int goldValue;
ESM::Position pos;
int drawState;
float headPitch;
float headYaw;
int doorState;
int lockLevel;
float scale;
std::string filename;
bool allowSkipping;
std::string animGroup;
int animMode;
int index;
int shortVal;
float floatVal;
std::string varName;
ContainerChanges containerChanges;
Animation animation;
bool hasAnimation;
AnimStates animStates;
bool hasAnimStates;
Movement movement;
bool hasMovement;
};
struct ObjectChanges
{
std::vector<WorldObject> objects;
unsigned int count;
};
class BaseEvent
{
public:
BaseEvent(RakNet::RakNetGUID guid) : guid(guid)
{
}
BaseEvent()
{
}
enum WORLD_ACTION
{
SET = 0,
ADD = 1,
REMOVE = 2,
REQUEST = 3
};
RakNet::RakNetGUID guid;
ObjectChanges objectChanges;
ESM::Cell cell;
unsigned char action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items
};
}
#endif //OPENMW_BASEEVENT_HPP