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

Method checkSize

MicropolisCore/src/MicropolisEngine/src/tool.cpp:540–556  ·  view source on GitHub ↗

* Return the size of the zone that the tile belongs to. * @param tileValue Value of the tile in the zone. * @return Size of the zone if it is a known tile value, else \c 0. */

Source from the content-addressed store, hash-verified

538 * @return Size of the zone if it is a known tile value, else \c 0.
539 */
540short Micropolis::checkSize(short tileValue)
541{
542 // check for the normal com, resl, ind 3x3 zones & the fireDept & PoliceDept
543 if ((tileValue >= RESBASE - 1 && tileValue <= PORTBASE - 1) ||
544 (tileValue >= LASTPOWERPLANT + 1 && tileValue <= POLICESTATION + 4) ||
545 (tileValue >= CHURCH1BASE && tileValue <= CHURCH7LAST)) {
546 return 3;
547 }
548
549 if ((tileValue >= PORTBASE && tileValue <= LASTPORT) ||
550 (tileValue >= COALBASE && tileValue <= LASTPOWERPLANT) ||
551 (tileValue >= STADIUMBASE && tileValue <= LASTZONE)) {
552 return 4;
553 }
554
555 return 0;
556}
557
558
559/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected