git push
This commit is contained in:
parent
4e26fbb58b
commit
acb4e585e6
@ -3,6 +3,7 @@
|
|||||||
#include "mt/PveGeminiContent.h"
|
#include "mt/PveGeminiContent.h"
|
||||||
|
|
||||||
IMPL_TABLE(mt::PveGeminiContent)
|
IMPL_TABLE(mt::PveGeminiContent)
|
||||||
|
std::map<int, std::vector<const mt::PveGeminiContent*>> mt::PveGeminiContent::mode_hash_;
|
||||||
|
|
||||||
namespace mt
|
namespace mt
|
||||||
{
|
{
|
||||||
@ -14,11 +15,20 @@ namespace mt
|
|||||||
for (auto& str : strings) {
|
for (auto& str : strings) {
|
||||||
_enemys.push_back(a8::XValue(str));
|
_enemys.push_back(a8::XValue(str));
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
auto itr = mode_hash_.find(mode_id());
|
||||||
|
if (itr != mode_hash_.end()) {
|
||||||
|
itr->second.push_back(this);
|
||||||
|
} else {
|
||||||
|
mode_hash_[mode_id()] = std::vector<const mt::PveGeminiContent*>({this});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const mt::PveGeminiContent*>* PveGeminiContent::GetContentsByMode(int mode)
|
const std::vector<const mt::PveGeminiContent*>* PveGeminiContent::GetContentsByMode(int mode)
|
||||||
{
|
{
|
||||||
return nullptr;
|
auto itr = mode_hash_.find(mode);
|
||||||
|
return itr != mode_hash_.end() ? &itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,11 @@ namespace mt
|
|||||||
std::vector<int> _enemys;
|
std::vector<int> _enemys;
|
||||||
|
|
||||||
void Init1();
|
void Init1();
|
||||||
static std::vector<const mt::PveGeminiContent*>* GetContentsByMode(int mode);
|
static const std::vector<const mt::PveGeminiContent*>* GetContentsByMode(int mode);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::map<int, std::vector<const mt::PveGeminiContent*>> mode_hash_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user