* Check at position \a pos for a power-less conducting tile in the * direction \a testDir. * @param pos Position to start from. * @param testDir Direction to investigate. * @return Unpowered tile has been found in the indicated direction. * @todo Re-use something like Micropolis::getFromMap(), and fold this function * into its caller. */
| 92 | * into its caller. |
| 93 | */ |
| 94 | bool Micropolis::testForConductive(const Position& pos, Direction2 testDir) |
| 95 | { |
| 96 | Position movedPos(pos); |
| 97 | |
| 98 | if (movedPos.move(testDir)) { |
| 99 | if ((map[movedPos.posX][movedPos.posY] & CONDBIT) == CONDBIT) { |
| 100 | if (!powerGridMap.worldGet(movedPos.posX, movedPos.posY)) { |
| 101 | return true; |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | /** |