scans a single tile for channel designations
| 154 | |
| 155 | // scans a single tile for channel designations |
| 156 | void ChannelGroups::scan_one(const df::coord &map_pos) { |
| 157 | df::map_block* block = Maps::getTileBlock(map_pos); |
| 158 | int16_t lx = map_pos.x % 16; |
| 159 | int16_t ly = map_pos.y % 16; |
| 160 | if (is_dig_designation(block->designation[lx][ly])) { |
| 161 | for (df::block_square_event* event: block->block_events) { |
| 162 | if (auto evT = virtual_cast<df::block_square_event_designation_priorityst>(event)) { |
| 163 | // we want to let the user keep some designations free of being managed |
| 164 | if (evT->priority[lx][ly] < 1000 * config.ignore_threshold) { |
| 165 | TRACE(groups).print(" adding (" COORD ")\n", COORDARGS(map_pos)); |
| 166 | add(map_pos); |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | } else if (TileCache::Get().hasChanged(map_pos, block->tiletype[lx][ly])) { |
| 171 | TileCache::Get().uncache(map_pos); |
| 172 | remove(map_pos); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // builds groupings of adjacent channel designations |
| 177 | void ChannelGroups::scan(bool full_scan) { |
no test coverage detected