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

Method putOnMap

MicropolisCore/src/MicropolisEngine/src/generate.cpp:583–607  ·  view source on GitHub ↗

* Put \a mChar onto the map at position \a xLoc, \a yLoc if possible. * @param mChar Map value to put ont the map. * @param xLoc Horizontal position at the map to put \a mChar. * @param yLoc Vertical position at the map to put \a mChar. */

Source from the content-addressed store, hash-verified

581 * @param yLoc Vertical position at the map to put \a mChar.
582 */
583void Micropolis::putOnMap(MapValue mChar, short xLoc, short yLoc)
584{
585 if (mChar == 0) {
586 return;
587 }
588
589 if (!testBounds(xLoc, yLoc)) {
590 return;
591 }
592
593 MapValue temp = map[xLoc][yLoc];
594
595 if (temp != DIRT) {
596 temp = temp & LOMASK;
597 if (temp == RIVER) {
598 if (mChar != CHANNEL) {
599 return;
600 }
601 }
602 if (temp == CHANNEL) {
603 return;
604 }
605 }
606 map[xLoc][yLoc] = mChar;
607}
608
609/**
610 * Put down a big river diamond-like shape.

Callers

nothing calls this directly

Calls 1

testBoundsFunction · 0.85

Tested by

no test coverage detected