openmw-tes3coop/components/openmw-mp/Base/BaseEvent.hpp
David Cernat 4846497078 Merge pull request #415 from TES3MP/0.6.3 while resolving conflicts
Conflicts:
	apps/openmw-mp/Script/Functions/Positions.cpp
	apps/openmw-mp/Script/Functions/Positions.hpp
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw-mp/Script/Functions/World.hpp
	apps/openmw-mp/Script/Script.hpp
	apps/openmw-mp/Script/ScriptFunctions.cpp
	components/openmw-mp/Base/BasePlayer.hpp
2018-05-02 23:15:39 +03:00

114 lines
2.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;
float 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;
unsigned refNumIndex;
unsigned mpNum;
int count;
int charge;
float enchantmentCharge;
int goldValue;
ESM::Position position;
bool objectState;
int lockLevel;
float scale;
int doorState;
bool teleportState;
ESM::Cell destinationCell;
ESM::Position destinationPosition;
std::string filename;
bool allowSkipping;
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 class Action : uint8_t
{
Set = 0,
Add,
Remove,
Request
};
enum class ContainerSubAction : uint8_t
{
None = 0,
Drag,
Drop,
TakeAll
};
RakNet::RakNetGUID guid;
std::vector<WorldObject> worldObjects;
ESM::Cell cell;
std::string consoleCommand;
Action action;
ContainerSubAction containerSubAction;
bool isValid;
};
}
#endif //OPENMW_BASEEVENT_HPP