This commit is contained in:
aozhiwei 2023-05-29 16:38:55 +08:00
parent d4029bffb8
commit b5d5823dfa
4 changed files with 10 additions and 1 deletions

View File

@ -12,10 +12,14 @@ namespace mt
public: public:
void Init1(); void Init1();
std::shared_ptr<std::tuple<float, float, float, int>> GetBoss() { return _boss; }
static const SafeArea* GetByType(int type); static const SafeArea* GetByType(int type);
private: private:
static std::map<int, const SafeArea*> type_hash_; static std::map<int, const SafeArea*> type_hash_;
std::shared_ptr<std::tuple<float, float, float, int>> _boss;
}; };
} }

View File

@ -19,6 +19,7 @@ namespace mtb
int type() const { return type_; }; int type() const { return type_; };
int x1() const { return x1_; }; int x1() const { return x1_; };
int y1() const { return y1_; }; int y1() const { return y1_; };
std::string boss() const { return boss_; };
bool has_id() const { return __flags__.test(0);}; bool has_id() const { return __flags__.test(0);};
bool has_level() const { return __flags__.test(1);}; bool has_level() const { return __flags__.test(1);};
@ -29,6 +30,7 @@ namespace mtb
bool has_type() const { return __flags__.test(6);}; bool has_type() const { return __flags__.test(6);};
bool has_x1() const { return __flags__.test(7);}; bool has_x1() const { return __flags__.test(7);};
bool has_y1() const { return __flags__.test(8);}; bool has_y1() const { return __flags__.test(8);};
bool has_boss() const { return __flags__.test(9);};
protected: protected:
@ -41,6 +43,7 @@ namespace mtb
int type_ = 0; int type_ = 0;
int x1_ = 0; int x1_ = 0;
int y1_ = 0; int y1_ = 0;
std::string boss_;
public: public:
std::bitset<9> __flags__; std::bitset<9> __flags__;

View File

@ -161,7 +161,7 @@ namespace mtb
{ {
a8::reflect::Class* meta_class = nullptr; a8::reflect::Class* meta_class = nullptr;
if (!meta_class) { if (!meta_class) {
meta_class = new a8::reflect::Class("SafeArea", 9, 0); meta_class = new a8::reflect::Class("SafeArea", 10, 0);
meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(SafeArea, id_)); meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(SafeArea, id_));
meta_class->SetSimpleField(1, "level", a8::reflect::ET_INT32, my_offsetof2(SafeArea, level_)); meta_class->SetSimpleField(1, "level", a8::reflect::ET_INT32, my_offsetof2(SafeArea, level_));
meta_class->SetSimpleField(2, "rad", a8::reflect::ET_INT32, my_offsetof2(SafeArea, rad_)); meta_class->SetSimpleField(2, "rad", a8::reflect::ET_INT32, my_offsetof2(SafeArea, rad_));
@ -171,6 +171,7 @@ namespace mtb
meta_class->SetSimpleField(6, "type", a8::reflect::ET_INT32, my_offsetof2(SafeArea, type_)); meta_class->SetSimpleField(6, "type", a8::reflect::ET_INT32, my_offsetof2(SafeArea, type_));
meta_class->SetSimpleField(7, "x1", a8::reflect::ET_INT32, my_offsetof2(SafeArea, x1_)); meta_class->SetSimpleField(7, "x1", a8::reflect::ET_INT32, my_offsetof2(SafeArea, x1_));
meta_class->SetSimpleField(8, "y1", a8::reflect::ET_INT32, my_offsetof2(SafeArea, y1_)); meta_class->SetSimpleField(8, "y1", a8::reflect::ET_INT32, my_offsetof2(SafeArea, y1_));
meta_class->SetSimpleField(9, "boss", a8::reflect::ET_STRING, my_offsetof2(SafeArea, boss_));
} }
return meta_class; return meta_class;
} }

View File

@ -100,6 +100,7 @@ message SafeArea
optional int32 type = 7; optional int32 type = 7;
optional int32 x1 = 8; optional int32 x1 = 8;
optional int32 y1 = 9; optional int32 y1 = 9;
optional string boss = 10;
} }
message SafeAreaPos message SafeAreaPos