This commit is contained in:
aozhiwei 2023-06-20 16:43:10 +08:00
parent 6b6daeda98
commit 1bf347bf12
5 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#include "precompile.h"
#include "mt/SafeAreaSafePoint.h"
IMPL_TABLE(mt::SafeAreaSafePoint)
std::map<int, std::vector<glm::vec3>> mt::SafeAreaSafePoint::_type_safe_points_hash;
namespace mt
{
void SafeAreaSafePoint::Init1()
{
}
void SafeAreaSafePoint::StaticPostInit()
{
}
glm::vec3* SafeAreaSafePoint::RandPoint(int type) const
{
}
}

View File

@ -0,0 +1,22 @@
#pragma once
#include "mt/macro.h"
#include "mtb/SafeAreaSafePoint.h"
namespace mt
{
DECLARE_ID_TABLE(SafeAreaSafePoint, mtb::SafeAreaSafePoint,
"safearea_safepoint@safearea_safepoint.json",
"id")
public:
void Init1();
static void StaticPostInit();
glm::vec3* RandPoint(int type) const;
private:
static std::map<int, std::vector<glm::vec3>> _type_safe_points_hash;
};
}

View File

@ -0,0 +1,37 @@
#pragma once
#include <bitset>
namespace mtb
{
class SafeAreaSafePoint
{
public:
a8::reflect::Class* GetClass() const;
int id() const { return id_; };
int type() const { return type_; };
float x() const { return x_; };
float y() const { return y_; };
float z() const { return z_; };
bool has_id() const { return __flags__.test(0);};
bool has_type() const { return __flags__.test(1);};
bool has_x() const { return __flags__.test(2);};
bool has_y() const { return __flags__.test(3);};
bool has_z() const { return __flags__.test(4);};
protected:
int id_ = 0;
int type_ = 0;
float x_ = 0;
float y_ = 0;
float z_ = 0;
public:
std::bitset<5> __flags__;
};
};

View File

@ -40,6 +40,7 @@
#include "mtb/WorldObject.h" #include "mtb/WorldObject.h"
#include "mtb/MergeItem.h" #include "mtb/MergeItem.h"
#include "mtb/MapThingGroup.h" #include "mtb/MapThingGroup.h"
#include "mtb/SafeAreaSafePoint.h"
namespace mtb namespace mtb
{ {
@ -853,4 +854,18 @@ namespace mtb
return meta_class; return meta_class;
} }
a8::reflect::Class* SafeAreaSafePoint::GetClass() const
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("SafeAreaSafePoint", 5, 0);
meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(SafeAreaSafePoint, id_));
meta_class->SetSimpleField(1, "type", a8::reflect::ET_INT32, my_offsetof2(SafeAreaSafePoint, type_));
meta_class->SetSimpleField(2, "x", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, x_));
meta_class->SetSimpleField(3, "y", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, y_));
meta_class->SetSimpleField(3, "z", a8::reflect::ET_FLOAT, my_offsetof2(SafeAreaSafePoint, z_));
}
return meta_class;
}
} }

View File

@ -103,6 +103,15 @@ message SafeArea
optional string boss = 10; optional string boss = 10;
} }
message SafeAreaSafePoint
{
optional int32 id = 1;
optional int32 type = 2;
optional float x = 8;
optional float y = 9;
optional float z = 10;
}
message SafeAreaPos message SafeAreaPos
{ {
optional int32 id = 1; optional int32 id = 1;