279 lines
9.4 KiB
C++
Executable File
279 lines
9.4 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <dtEntity/messagefactory.h>
|
|
#include <dtEntity/message.h>
|
|
#include <dtEntity/property.h>
|
|
|
|
namespace VCtrl
|
|
{
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
void RegisterMessageTypes(dtEntity::MessageFactory& em);
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class NavMeshGroupChangedMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
// type identifier of this message class
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
static const dtEntity::StringId GroupNameId;
|
|
static const dtEntity::StringId PreviousGroupNameId;
|
|
|
|
NavMeshGroupChangedMessage();
|
|
|
|
// Create a copy of this message on the heap
|
|
dtEntity::Message* Clone() const override { return CloneContainer<NavMeshGroupChangedMessage>(); }
|
|
|
|
void SetAboutEntityId(dtEntity::EntityId id) { mAboutEntity.Set(id); }
|
|
dtEntity::EntityId GetAboutEntityId() const { return mAboutEntity.Get(); }
|
|
|
|
void SetGroupName(const std::string& v) { mGroupName.Set(v); }
|
|
std::string GetGroupName() const { return mGroupName.Get(); }
|
|
|
|
void SetPreviousGroupName(const std::string& v) { mPreviousGroupName.Set(v); }
|
|
std::string GetPreviousGroupName() const { return mPreviousGroupName.Get(); }
|
|
private:
|
|
|
|
dtEntity::IntProperty mAboutEntity;
|
|
dtEntity::StringProperty mGroupName;
|
|
dtEntity::StringProperty mPreviousGroupName;
|
|
|
|
};
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class TransformSendMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
static const dtEntity::StringId PositionId;
|
|
static const dtEntity::StringId AttitudeId;
|
|
static const dtEntity::StringId RoomNumberId;
|
|
|
|
TransformSendMessage();
|
|
|
|
dtEntity::Message* Clone() const override { return CloneContainer<TransformSendMessage>(); }
|
|
|
|
void SetAboutEntity(dtEntity::EntityId id) { mAboutEntity.Set(id); }
|
|
dtEntity::EntityId GetAboutEntity() const { return mAboutEntity.Get(); }
|
|
|
|
void SetPosition(const osg::Vec3f& id) { mPosition.Set(id); }
|
|
osg::Vec3f GetPosition() const { return mPosition.Get(); }
|
|
|
|
void SetAttitude(const osg::Quat& id) { mAttitude.Set(id); }
|
|
osg::Quat GetAttitude() const { return mAttitude.Get(); }
|
|
|
|
void SetRoomNumber(dtEntity::EntityId roomNumber) { mRoomNumber.Set(roomNumber); }
|
|
dtEntity::EntityId GetRoomNumber() const { return mRoomNumber.Get(); }
|
|
|
|
private:
|
|
|
|
dtEntity::UIntProperty mAboutEntity;
|
|
dtEntity::Vec3Property mPosition;
|
|
dtEntity::QuatProperty mAttitude;
|
|
dtEntity::UIntProperty mRoomNumber;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class PlayerPickedMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
static const dtEntity::StringId PositionId;
|
|
|
|
PlayerPickedMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<PlayerPickedMessage>(); }
|
|
|
|
void SetAboutEntityId(dtEntity::EntityId v) { mAboutEntity.Set(v); }
|
|
dtEntity::EntityId GetAboutEntityId() const { return mAboutEntity.Get(); }
|
|
|
|
void SetPosition(const osg::Vec3f& v) { mPosition.Set(v); }
|
|
osg::Vec3f GetPosition() const { return mPosition.Get(); }
|
|
|
|
private:
|
|
dtEntity::UIntProperty mAboutEntity;
|
|
dtEntity::Vec3Property mPosition;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class FastForwardMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
// type identifier of this message class
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId EndTimeId;
|
|
|
|
FastForwardMessage();
|
|
|
|
// Create a copy of this message on the heap
|
|
dtEntity::Message* Clone() const override { return CloneContainer<FastForwardMessage>(); }
|
|
|
|
void SetEndTime(double v) { mEndTime.Set(v); }
|
|
double GetEndTime() const { return mEndTime.Get(); }
|
|
|
|
private:
|
|
|
|
dtEntity::DoubleProperty mEndTime;
|
|
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class HideSelectionMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
static const dtEntity::StringId NameFlagId;
|
|
|
|
HideSelectionMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<HideSelectionMessage>(); }
|
|
|
|
void SetAboutEntityId(dtEntity::EntityId v) { mAboutEntity.Set(v); }
|
|
dtEntity::EntityId GetAboutEntityId() const { return mAboutEntity.Get(); }
|
|
|
|
void SetNameFlagId(bool v) { mNameFlag.Set(v); }
|
|
bool GetNameFlagId() const { return mNameFlag.Get(); }
|
|
|
|
private:
|
|
dtEntity::UIntProperty mAboutEntity;
|
|
dtEntity::BoolProperty mNameFlag;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class RemoveShootMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
|
|
RemoveShootMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<RemoveShootMessage>(); }
|
|
|
|
void SetId(int32_t id) { mId = id; }
|
|
int32_t GetId() { return mId; }
|
|
|
|
private:
|
|
int32_t mId { 0 };
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class ShootMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
|
|
ShootMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<ShootMessage>(); }
|
|
|
|
void SetShooter(dtEntity::EntityId v) { mShooter = v; }
|
|
dtEntity::EntityId GetShooter() const { return mShooter; }
|
|
void SetShooterPos(const dtEntity::Vec3d &shooterPos) { mShooterPos = shooterPos; }
|
|
dtEntity::Vec3d GetShooterPos() const { return mShooterPos; }
|
|
|
|
void SetTarget(dtEntity::EntityId v) { mTarget = v; }
|
|
dtEntity::EntityId GetTarget() const { return mTarget; }
|
|
void SetTargetPos(const dtEntity::Vec3d &targetPos) { mTargetPos = targetPos; }
|
|
dtEntity::Vec3d GetTargetPos() const { return mTargetPos; }
|
|
|
|
void SetBuildingIdSrc(dtEntity::EntityId v) { mBuildingIdSrc = v; }
|
|
dtEntity::EntityId GetBuildingIdSrc() const { return mBuildingIdSrc; }
|
|
void SetRoomNumberSrc(const dtEntity::EntityId &v) { mRoomNumberSrc = v; }
|
|
dtEntity::EntityId GetRoomNumberSrc() const { return mRoomNumberSrc; }
|
|
|
|
void SetBuildingIdDst(dtEntity::EntityId v) { mBuildingIdDst = v; }
|
|
dtEntity::EntityId GetBuildingIdDst() const { return mBuildingIdDst; }
|
|
void SetRoomNumberDst(const dtEntity::EntityId &v) { mRoomNumberDst = v; }
|
|
dtEntity::EntityId GetRoomNumberDst() const { return mRoomNumberDst; }
|
|
|
|
void SetDuration(float v) { mDuration = v; }
|
|
float GetDuration() const { return mDuration; }
|
|
|
|
void SetLineType(int v) { mLineType = v; }
|
|
float GetLineType() const { return mLineType; }
|
|
|
|
void SetSimTimeCreated(double v) { mSimTimeCreated = v; }
|
|
double GetSimTimeCreated() const { return mSimTimeCreated; }
|
|
|
|
void SetId(int32_t id) { mId = id; }
|
|
int32_t GetId() const { return mId; }
|
|
|
|
private:
|
|
int32_t mId { 0 };
|
|
dtEntity::Vec3d mShooterPos;
|
|
dtEntity::Vec3d mTargetPos;
|
|
dtEntity::EntityId mShooter = 0;
|
|
dtEntity::EntityId mTarget = 0;
|
|
dtEntity::EntityId mBuildingIdSrc = 0;
|
|
dtEntity::EntityId mRoomNumberSrc = 0;
|
|
dtEntity::EntityId mBuildingIdDst = 0;
|
|
dtEntity::EntityId mRoomNumberDst = 0;
|
|
int mLineType = 0;
|
|
float mDuration = 0.f;
|
|
double mSimTimeCreated = 0;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class ShowHidePlayerMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
|
|
ShowHidePlayerMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<ShowHidePlayerMessage>(); }
|
|
|
|
void SetAboutEntityId(dtEntity::EntityId v) { mAboutEntity.Set(v); }
|
|
dtEntity::EntityId GetAboutEntityId() const { return mAboutEntity.Get(); }
|
|
|
|
void SetShow(bool v) { mShow = v; }
|
|
bool GetShow() const { return mShow; }
|
|
|
|
private:
|
|
dtEntity::UIntProperty mAboutEntity = 0;
|
|
bool mShow = false;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////<
|
|
class DisplayNameClickedMessage
|
|
: public dtEntity::Message
|
|
{
|
|
public:
|
|
|
|
static const dtEntity::MessageType TYPE;
|
|
static const dtEntity::StringId AboutEntityId;
|
|
static const dtEntity::StringId PositionId;
|
|
|
|
DisplayNameClickedMessage();
|
|
dtEntity::Message* Clone() const override { return CloneContainer<DisplayNameClickedMessage>(); }
|
|
|
|
void SetAboutEntityId(dtEntity::EntityId v) { mAboutEntity.Set(v); }
|
|
dtEntity::EntityId GetAboutEntityId() const { return mAboutEntity.Get(); }
|
|
|
|
void SetPosition(const osg::Vec3f& v) { mPosition.Set(v); }
|
|
osg::Vec3f GetPosition() const { return mPosition.Get(); }
|
|
|
|
private:
|
|
dtEntity::UIntProperty mAboutEntity;
|
|
dtEntity::Vec3Property mPosition;
|
|
};
|
|
}
|