This commit is contained in:
aozhiwei 2023-02-17 19:16:30 +08:00
parent 25311965c5
commit 1e63ae1588
9 changed files with 229 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#include "precompile.h"
#include "mt/Grasp.h"
IMPL_TABLE(mt::Grasp)
namespace mt
{
void Grasp::Init1()
{
}
void Grasp::Init2()
{
}
}

View File

@ -0,0 +1,19 @@
#pragma once
#include "mt/macro.h"
#include "mtb/Grasp.h"
namespace mt
{
DECLARE_ID_TABLE(AI, mtb::Grasp,
"grasp@grasp.json",
"grasp_id")
public:
void Init1();
void Init2();
};
}

View File

@ -0,0 +1,20 @@
#include "precompile.h"
#include "mt/GraspBuff.h"
IMPL_TABLE(mt::GraspBuff)
namespace mt
{
void GraspBuff::Init1()
{
}
void GraspBuff::Init2()
{
}
}

View File

@ -0,0 +1,19 @@
#pragma once
#include "mt/macro.h"
#include "mtb/GraspBuff.h"
namespace mt
{
DECLARE_ID_TABLE(AI, mtb::Grasp,
"graspbuff@graspbuff.json",
"graspbuff_id")
public:
void Init1();
void Init2();
};
}

View File

@ -35,6 +35,8 @@
#include "mt/SkillNumber.h"
#include "mt/MapArea.h"
#include "mt/MapCollider.h"
#include "mt/Grasp.h"
#include "mt/GraspBuff.h"
#include "app.h"
@ -99,6 +101,8 @@ namespace mt
RegMetaTable<Skill>(res_path_);
RegMetaTable<SkillNumber>(res_path_);
RegMetaTable<MapArea>(res_path_);
RegMetaTable<Grasp>(res_path_);
RegMetaTable<GraspBuff>(res_path_);
}
void MetaMgr::Load()

View File

@ -0,0 +1,40 @@
#pragma once
#include <bitset>
namespace mtb
{
class Grasp
{
public:
a8::reflect::Class* GetClass() const;
int grasp_id() const { return grasp_id_; };
int hero_id() const { return hero_id_; };
int hero_lv() const { return hero_lv_; };
int graspbuff_id1() const { return graspbuff_id1_; };
int graspbuff_id1_floor2() const { return graspbuff_id1_floor2_; };
int graspbuff_id2() const { return graspbuff_id2_; };
bool has_grasp_id() const { return __flags__.test(0);};
bool has_hero_id() const { return __flags__.test(1);};
bool has_hero_lv() const { return __flags__.test(2);};
bool has_graspbuff_id1() const { return __flags__.test(3);};
bool has_graspbuff_id1_floor2() const { return __flags__.test(4);};
bool has_graspbuff_id2() const { return __flags__.test(5);};
protected:
int grasp_id_ = 0;
int hero_id_ = 0;
int hero_lv_ = 0;
int graspbuff_id1_ = 0;
int graspbuff_id1_floor2_ = 0;
int graspbuff_id2_ = 0;
public:
std::bitset<6> __flags__;
};
};

View File

@ -0,0 +1,49 @@
#pragma once
#include <bitset>
namespace mtb
{
class GraspBuff
{
public:
a8::reflect::Class* GetClass() const;
int graspbuff_id() const { return graspbuff_id_; };
int graspbuff_floor() const { return graspbuff_floor_; };
const std::string graspbuff_trigger() const { return graspbuff_trigger_; };
int graspbuff_target() const { return graspbuff_target_; };
const std::string graspbuff_time() const { return graspbuff_time_; };
int attr_id() const { return attr_id_; };
int attr_add_pattern() const { return attr_add_pattern_; };
int attr_add_pattern2() const { return attr_add_pattern2_; };
const std::string attr_num() const { return attr_num_; };
bool has_graspbuff_id() const { return __flags__.test(0);};
bool has_graspbuff_floor() const { return __flags__.test(1);};
bool has_graspbuff_trigger() const { return __flags__.test(2);};
bool has_graspbuff_target() const { return __flags__.test(3);};
bool has_graspbuff_time() const { return __flags__.test(4);};
bool has_attr_id() const { return __flags__.test(5);};
bool has_attr_add_pattern() const { return __flags__.test(6);};
bool has_attr_add_pattern2() const { return __flags__.test(7);};
bool has_attr_num() const { return __flags__.test(8);};
protected:
int graspbuff_id_ = 0;
int graspbuff_floor_ = 0;
std::string graspbuff_trigger_;
int graspbuff_target_ = 0;
std::string graspbuff_time_;
int attr_id_ = 0;
int attr_add_pattern_ = 0;
int attr_add_pattern2_ = 0;
std::string attr_num_;
public:
std::bitset<9> __flags__;
};
};

View File

@ -34,6 +34,8 @@
#include "mtb/PveGeminiContent.h"
#include "mtb/PveGeminiMode.h"
#include "mtb/RankRoom.h"
#include "mtb/Grasp.h"
#include "mtb/GraspBuff.h"
namespace mtb
{
@ -734,4 +736,37 @@ namespace mtb
return meta_class;
}
a8::reflect::Class* Grasp::GetClass() const
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("Grasp", 6, 0);
meta_class->SetSimpleField(0, "grasp_id", a8::reflect::ET_INT32, my_offsetof2(Grasp, grasp_id_));
meta_class->SetSimpleField(1, "hero_id", a8::reflect::ET_INT32, my_offsetof2(Grasp, hero_id_));
meta_class->SetSimpleField(2, "hero_lv", a8::reflect::ET_INT32, my_offsetof2(Grasp, hero_lv_));
meta_class->SetSimpleField(3, "graspbuff_id1", a8::reflect::ET_INT32, my_offsetof2(Grasp, graspbuff_id1_));
meta_class->SetSimpleField(4, "graspbuff_id1_floor2", a8::reflect::ET_INT32, my_offsetof2(Grasp, graspbuff_id1_floor2_));
meta_class->SetSimpleField(5, "graspbuff_id2", a8::reflect::ET_INT32, my_offsetof2(Grasp, graspbuff_id2_));
}
return meta_class;
}
a8::reflect::Class* GraspBuff::GetClass() const
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("GraspBuff", 9, 0);
meta_class->SetSimpleField(0, "graspbuff_id", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, graspbuff_id_));
meta_class->SetSimpleField(1, "graspbuff_floor", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, graspbuff_floor_));
meta_class->SetSimpleField(2, "graspbuff_trigger", a8::reflect::ET_STRING, my_offsetof2(GraspBuff, graspbuff_trigger_));
meta_class->SetSimpleField(3, "graspbuff_target", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, graspbuff_target_));
meta_class->SetSimpleField(4, "graspbuff_time", a8::reflect::ET_STRING, my_offsetof2(GraspBuff, graspbuff_time_));
meta_class->SetSimpleField(5, "attr_id", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, attr_id_));
meta_class->SetSimpleField(6, "attr_add_pattern", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, attr_add_pattern_));
meta_class->SetSimpleField(7, "attr_add_pattern2", a8::reflect::ET_INT32, my_offsetof2(GraspBuff, attr_add_pattern2_));
meta_class->SetSimpleField(8, "attr_num", a8::reflect::ET_STRING, my_offsetof2(GraspBuff, attr_num_));
}
return meta_class;
}
}

View File

@ -547,3 +547,26 @@ message RankRoom
optional int32 final_time = 9;
optional int32 final_player_num = 10;
}
message Grasp
{
optional int32 grasp_id = 1;
optional int32 hero_id = 2;
optional int32 hero_lv = 3;
optional int32 graspbuff_id1 = 4;
optional int32 graspbuff_id1_floor2 = 5;
optional int32 graspbuff_id2 = 6;
}
message GraspBuff
{
optional int32 graspbuff_id = 1;
optional int32 graspbuff_floor = 2;
optional string graspbuff_trigger = 4;
optional int32 graspbuff_target = 5;
optional string graspbuff_time = 6;
optional int32 attr_id = 7;
optional int32 attr_add_pattern = 8;
optional int32 attr_add_pattern2 = 9;
optional string attr_num = 10;
}