1
This commit is contained in:
parent
f07f400287
commit
2b58177482
@ -49,6 +49,7 @@ public:
|
|||||||
std::list<MetaData::KillPoint> killpoint_list;
|
std::list<MetaData::KillPoint> killpoint_list;
|
||||||
std::list<metatable::Robot> robot_meta_list;
|
std::list<metatable::Robot> robot_meta_list;
|
||||||
std::vector<MetaData::Robot> robot_list;
|
std::vector<MetaData::Robot> robot_list;
|
||||||
|
std::list<metatable::Text> text_meta_list;
|
||||||
|
|
||||||
std::map<std::string, MetaData::Parameter*> parameter_hash;
|
std::map<std::string, MetaData::Parameter*> parameter_hash;
|
||||||
std::map<int, MetaData::Map*> gamemap_hash;
|
std::map<int, MetaData::Map*> gamemap_hash;
|
||||||
@ -72,6 +73,7 @@ public:
|
|||||||
std::map<int, MetaData::EquipUpgrade*> equipupgrade_hash;
|
std::map<int, MetaData::EquipUpgrade*> equipupgrade_hash;
|
||||||
std::map<int, MetaData::Robot*> robot_hash;
|
std::map<int, MetaData::Robot*> robot_hash;
|
||||||
std::map<int, std::vector<MetaData::AirLine*>> airline_hash;
|
std::map<int, std::vector<MetaData::AirLine*>> airline_hash;
|
||||||
|
std::map<std::string, std::string> text_hash;
|
||||||
|
|
||||||
void Load()
|
void Load()
|
||||||
{
|
{
|
||||||
@ -115,6 +117,7 @@ public:
|
|||||||
f8::ReadCsvMetaFile(res_path + "rankPoint@rankPoint.csv", rankpoint_meta_list);
|
f8::ReadCsvMetaFile(res_path + "rankPoint@rankPoint.csv", rankpoint_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "equipUpgrade@equipUpgrade.csv", equipupgrade_meta_list);
|
f8::ReadCsvMetaFile(res_path + "equipUpgrade@equipUpgrade.csv", equipupgrade_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list);
|
f8::ReadCsvMetaFile(res_path + "robot@robot.csv", robot_meta_list);
|
||||||
|
f8::ReadCsvMetaFile(res_path + "text@text.csv", text_meta_list);
|
||||||
BindToMetaData();
|
BindToMetaData();
|
||||||
#if 1
|
#if 1
|
||||||
{
|
{
|
||||||
@ -310,6 +313,10 @@ private:
|
|||||||
robot_hash[meta.id()] = &item;
|
robot_hash[meta.id()] = &item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& meta : text_meta_list) {
|
||||||
|
text_hash[meta.textid()] = meta.text();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -496,3 +503,9 @@ MetaData::Robot* MetaMgr::GetRobot(int robot_id)
|
|||||||
auto itr = loader_->robot_hash.find(robot_id);
|
auto itr = loader_->robot_hash.find(robot_id);
|
||||||
return itr != loader_->robot_hash.end() ? itr->second : nullptr;
|
return itr != loader_->robot_hash.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string MetaMgr::GetText(const std::string& textid, const std::string& def_text)
|
||||||
|
{
|
||||||
|
auto itr = loader_->text_hash.find(textid);
|
||||||
|
return itr != loader_->text_hash.end() ? itr->second : def_text;
|
||||||
|
}
|
||||||
|
@ -42,6 +42,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
|||||||
int GetKillPointParam2(int kill_num);
|
int GetKillPointParam2(int kill_num);
|
||||||
std::vector<MetaData::Robot>* GetRobotList();
|
std::vector<MetaData::Robot>* GetRobotList();
|
||||||
MetaData::Robot* GetRobot(int robot_id);
|
MetaData::Robot* GetRobot(int robot_id);
|
||||||
|
std::string GetText(const std::string& textid, const std::string& def_text);
|
||||||
|
|
||||||
int gas_inactive_time = 10;
|
int gas_inactive_time = 10;
|
||||||
int jump_time = 10;
|
int jump_time = 10;
|
||||||
|
@ -190,6 +190,12 @@ message KillPoint
|
|||||||
optional int32 parameter2 = 3;
|
optional int32 parameter2 = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Text
|
||||||
|
{
|
||||||
|
optional string textid = 1;
|
||||||
|
optional string text = 2;
|
||||||
|
}
|
||||||
|
|
||||||
//end
|
//end
|
||||||
|
|
||||||
message DoorObjJson
|
message DoorObjJson
|
||||||
|
Loading…
x
Reference in New Issue
Block a user