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

103 lines
2 KiB
C++
Raw Normal View History

#ifndef OPENMW_BASEEVENT_HPP
#define OPENMW_BASEEVENT_HPP
2016-10-22 17:15:32 +00:00
#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;
double enchantmentCharge;
int actionCount;
inline bool operator==(const ContainerItem& rhs)
{
return refId == rhs.refId && count == rhs.count && charge == rhs.charge && enchantmentCharge == rhs.enchantmentCharge;
}
};
struct WorldObject
{
std::string refId;
int refNumIndex;
int mpNum;
int count;
int charge;
double enchantmentCharge;
int goldValue;
ESM::Position position;
2017-07-13 06:46:30 +00:00
bool objectState;
int doorState;
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;
bool isDisarmed;
bool droppedByPlayer;
Target master;
bool hasMaster;
std::vector<ContainerItem> containerItems;
unsigned int containerItemCount;
RakNet::RakNetGUID guid; // only for events that can also affect players
bool isPlayer;
};
class BaseEvent
{
public:
BaseEvent(RakNet::RakNetGUID guid) : guid(guid)
{
}
BaseEvent()
{
}
enum WORLD_ACTION
{
SET = 0,
ADD = 1,
REMOVE = 2,
REQUEST = 3
};
RakNet::RakNetGUID guid;
std::vector<WorldObject> worldObjects;
unsigned int worldObjectCount;
ESM::Cell cell;
std::string consoleCommand;
unsigned char action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items
bool isValid;
};
}
#endif //OPENMW_BASEEVENT_HPP