1
This commit is contained in:
parent
64b6b2d227
commit
a4438d093b
@ -1,5 +1,7 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include <a8/reflect.h>
|
||||
|
||||
#include "mt/Skill.h"
|
||||
#include "mt/Buff.h"
|
||||
#include "mt/SkillNumber.h"
|
||||
@ -20,35 +22,33 @@ namespace mt
|
||||
_buff_list.insert(a8::XValue(str));
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
const google::protobuf::Descriptor* descriptor = GetDescriptor();
|
||||
const google::protobuf::Reflection* reflection = GetReflection();
|
||||
auto class_meta = GetClass();
|
||||
for (int idx = 1; idx <= 100; ++idx) {
|
||||
MetaData::SkillPhase phase;
|
||||
mt::SkillPhase phase;
|
||||
{
|
||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_time_offset", {idx}));
|
||||
auto field_desc = class_meta->GetFieldByName(a8::Format("phase%d_time_offset", {idx}));
|
||||
if (!field_desc) {
|
||||
break;
|
||||
}
|
||||
phase.phase_idx = phases.size() + 1;
|
||||
phase.time_offset = reflection->GetInt32(*(metatable::Skill*)pb, field_desc);
|
||||
phase.phase_idx = _phases.size() + 1;
|
||||
phase.time_offset = *((int*)((char*)this + field_desc->offset));
|
||||
}
|
||||
{
|
||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_func", {idx}));
|
||||
phase.func_id = (SkillFunc_e)reflection->GetInt32(*(metatable::Skill*)pb, field_desc);
|
||||
auto field_desc = class_meta->GetFieldByName(a8::Format("phase%d_func", {idx}));
|
||||
phase.func_id = (SkillFunc_e)*((int*)((char*)this + field_desc->offset));
|
||||
}
|
||||
{
|
||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param1", {idx}));
|
||||
phase.param1_str = reflection->GetString(*(metatable::Skill*)pb, field_desc);
|
||||
auto field_desc = class_meta->GetFieldByName(a8::Format("phase%d_param1", {idx}));
|
||||
phase.param1_str = *((std::string*)((char*)this + field_desc->offset));
|
||||
}
|
||||
{
|
||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param2", {idx}));
|
||||
phase.param2_str = reflection->GetString(*(metatable::Skill*)pb, field_desc);
|
||||
auto field_desc = class_meta->GetFieldByName(a8::Format("phase%d_param2", {idx}));
|
||||
phase.param2_str = *((std::string*)((char*)this + field_desc->offset));
|
||||
}
|
||||
{
|
||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param3", {idx}));
|
||||
phase.param3_str = reflection->GetString(*(metatable::Skill*)pb, field_desc);
|
||||
auto field_desc = class_meta->GetFieldByName(a8::Format("phase%d_param3", {idx}));
|
||||
phase.param3_str = *((std::string*)((char*)this + field_desc->offset));
|
||||
}
|
||||
{
|
||||
phase.param1 = a8::XValue(phase.param1_str);
|
||||
@ -76,13 +76,12 @@ namespace mt
|
||||
}
|
||||
}
|
||||
if (phase.func_id != kSkill_FuncNone) {
|
||||
phases.push_back(phase);
|
||||
_phases.push_back(phase);
|
||||
}
|
||||
raw_phases.push_back(phase);
|
||||
_raw_phases.push_back(phase);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
{
|
||||
SkillHelper::GetMagicIdAndBaseSkillId(skill_id(), _magic_id, _base_skill_id);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user