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

Method putRubble

MicropolisCore/src/MicropolisEngine/src/tool.cpp:910–925  ·  view source on GitHub ↗

* Make a \a size by \a size tiles square of rubble * @param x Horizontal position of the left-most tile * @param y Vertical position of the left-most tile * @param size Size of the rubble square */

Source from the content-addressed store, hash-verified

908 * @param size Size of the rubble square
909 */
910void Micropolis::putRubble(int x, int y, int size, ToolEffects *effects)
911{
912 for (int xx = x; xx < x + size; xx++) {
913 for (int yy = y; yy < y + size; yy++) {
914
915 if (testBounds(xx, yy)) {
916 int tile = effects->getMapTile(xx, yy);
917
918 if (tile != RADTILE && tile != DIRT) {
919 tile = (doAnimation ? (TINYEXP + getRandom(2)) : SOMETINYEXP);
920 effects->setMapValue(xx, yy, tile | ANIMBIT | BULLBIT);
921 }
922 }
923 }
924 }
925}
926
927
928/**

Callers

nothing calls this directly

Calls 3

testBoundsFunction · 0.85
getMapTileMethod · 0.80
setMapValueMethod · 0.60

Tested by

no test coverage detected