mirror of
https://github.com/isledecomp/LEGOIslandRebuilder.git
synced 2025-02-17 00:20:40 -05:00
patchgrid: add function to return item description
This commit is contained in:
parent
357c26048c
commit
ed0d18779f
2 changed files with 16 additions and 0 deletions
|
@ -315,6 +315,16 @@ void PatchGrid::AddD3DDevice(const string &name, const string &id)
|
|||
m_d3dDeviceIDs.push_back(id);
|
||||
}
|
||||
|
||||
CString PatchGrid::GetItemDescription(HITEM item)
|
||||
{
|
||||
for (std::map<std::string, HITEM>::const_iterator it=m_mPatchItems.begin(); it!=m_mPatchItems.end(); it++) {
|
||||
if (it->second == item) {
|
||||
return GetItemDescription(it->first);
|
||||
}
|
||||
}
|
||||
return CString();
|
||||
}
|
||||
|
||||
void PatchGrid::AddPatch(const string &id, const CString &description, HITEM item)
|
||||
{
|
||||
m_mPatchItems[id] = item;
|
||||
|
|
|
@ -14,6 +14,12 @@ public:
|
|||
|
||||
void AddD3DDevice(const std::string &name, const std::string &id);
|
||||
|
||||
CString GetItemDescription(HITEM item);
|
||||
CString GetItemDescription(const std::string &key)
|
||||
{
|
||||
return m_mPatchDescriptions[key];
|
||||
}
|
||||
|
||||
private:
|
||||
void AddPatch(const std::string &id, const CString &description, HITEM item);
|
||||
|
||||
|
|
Loading…
Reference in a new issue