2017-02-06 10:53:41 +00:00
|
|
|
#ifndef OPENMW_BASEEVENT_HPP
|
|
|
|
#define OPENMW_BASEEVENT_HPP
|
2016-10-20 11:28:19 +00:00
|
|
|
|
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>
|
2016-10-20 11:28:19 +00:00
|
|
|
#include <RakNetTypes.h>
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2017-02-15 18:14:25 +00:00
|
|
|
struct ContainerItem
|
|
|
|
{
|
|
|
|
std::string refId;
|
|
|
|
int count;
|
|
|
|
int charge;
|
|
|
|
|
|
|
|
int actionCount;
|
|
|
|
|
|
|
|
inline bool operator==(const ContainerItem& rhs)
|
|
|
|
{
|
2017-02-20 10:31:11 +00:00
|
|
|
return refId == rhs.refId && count == rhs.count && charge == rhs.charge;
|
2017-02-15 18:14:25 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ContainerChanges
|
|
|
|
{
|
|
|
|
std::vector<ContainerItem> items;
|
|
|
|
unsigned int count;
|
|
|
|
};
|
|
|
|
|
2017-01-28 10:34:45 +00:00
|
|
|
struct WorldObject
|
2016-10-20 11:28:19 +00:00
|
|
|
{
|
2017-01-28 10:34:45 +00:00
|
|
|
std::string refId;
|
|
|
|
int refNumIndex;
|
|
|
|
int count;
|
2017-02-06 19:28:03 +00:00
|
|
|
int charge;
|
2017-02-05 11:45:12 +00:00
|
|
|
int goldValue;
|
2016-10-25 11:07:00 +00:00
|
|
|
ESM::Position pos;
|
2016-11-21 21:40:50 +00:00
|
|
|
|
2017-02-06 21:09:50 +00:00
|
|
|
int doorState;
|
2016-10-24 10:20:04 +00:00
|
|
|
int lockLevel;
|
2016-10-24 21:52:42 +00:00
|
|
|
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-26 09:25:50 +00:00
|
|
|
|
2016-10-27 13:09:02 +00:00
|
|
|
std::string animGroup;
|
|
|
|
int animMode;
|
|
|
|
|
2016-10-26 09:25:50 +00:00
|
|
|
int index;
|
|
|
|
int shortVal;
|
|
|
|
float floatVal;
|
2016-10-26 21:41:14 +00:00
|
|
|
std::string varName;
|
2017-02-06 19:28:03 +00:00
|
|
|
|
2017-02-15 18:14:25 +00:00
|
|
|
ContainerChanges containerChanges;
|
2017-02-04 18:14:39 +00:00
|
|
|
};
|
|
|
|
|
2017-02-04 19:32:06 +00:00
|
|
|
struct ObjectChanges
|
|
|
|
{
|
|
|
|
std::vector<WorldObject> objects;
|
|
|
|
unsigned int count;
|
|
|
|
};
|
|
|
|
|
2017-02-06 10:53:41 +00:00
|
|
|
class BaseEvent
|
2017-01-28 10:34:45 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2017-02-06 10:53:41 +00:00
|
|
|
BaseEvent(RakNet::RakNetGUID guid) : guid(guid)
|
2017-01-28 10:34:45 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-02-06 10:53:41 +00:00
|
|
|
BaseEvent()
|
2017-01-28 10:34:45 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-02-15 18:14:25 +00:00
|
|
|
enum WORLD_ACTION
|
|
|
|
{
|
|
|
|
SET = 0,
|
|
|
|
ADD = 1,
|
|
|
|
REMOVE = 2,
|
|
|
|
REQUEST = 3
|
|
|
|
};
|
|
|
|
|
2017-01-28 10:34:45 +00:00
|
|
|
RakNet::RakNetGUID guid;
|
|
|
|
ObjectChanges objectChanges;
|
|
|
|
|
|
|
|
ESM::Cell cell;
|
2017-02-15 18:14:25 +00:00
|
|
|
|
|
|
|
int action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items
|
2017-01-28 10:34:45 +00:00
|
|
|
};
|
2016-10-20 11:28:19 +00:00
|
|
|
}
|
|
|
|
|
2017-02-06 10:53:41 +00:00
|
|
|
#endif //OPENMW_BASEEVENT_HPP
|