MCPcopy Create free account
hub / github.com/SimHacker/micropolis / getMapValue

Method getMapValue

MicropolisCore/src/MicropolisEngine/src/tool.cpp:161–171  ·  view source on GitHub ↗

* Get a map value from the world. * Unlike the simulator world, this method takes modifications made * previously by (other) tools into account. * @param pos Position of queried map value. Position must be on-map. * @return Map value of the queried position. */

Source from the content-addressed store, hash-verified

159 * @return Map value of the queried position.
160 */
161MapValue ToolEffects::getMapValue(const Position &pos) const
162{
163 WorldModificationsMap::const_iterator iter;
164
165 iter = this->modifications.find(pos);
166 if (iter == this->modifications.end()) {
167 return this->sim->map[pos.posX][pos.posY];
168 }
169
170 return (*iter).second;
171}
172
173/**
174 * Set a new map value.

Callers 3

putDownParkMethod · 0.60
bulldozerToolMethod · 0.60
forestToolMethod · 0.60

Calls

no outgoing calls

Tested by

no test coverage detected