MCPcopy Create free account
hub / github.com/cuberite/cuberite / AddToMap

Method AddToMap

src/BlockID.cpp:157–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157 void AddToMap(const AString & a_Name, const AString & a_Value)
158 {
159 AStringVector Split = StringSplit(a_Value, ":");
160 if (Split.size() == 1)
161 {
162 Split = StringSplit(a_Value, "^");
163 }
164 if (Split.empty())
165 {
166 return;
167 }
168 short ItemType = (short)atoi(Split[0].c_str());
169 short ItemDamage = (Split.size() > 1) ? (short)atoi(Split[1].c_str()) : -1;
170 m_Map[a_Name] = std::make_pair(ItemType, ItemDamage);
171 }
172} ;
173
174

Callers

nothing calls this directly

Calls 4

StringSplitFunction · 0.85
sizeMethod · 0.80
emptyMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected