| 49 | }; |
| 50 | |
| 51 | command_result tilesieve(color_ostream &out, std::vector<std::string> & params) |
| 52 | { |
| 53 | if (!Maps::IsValid()) |
| 54 | { |
| 55 | out.printerr("Map is not available!\n"); |
| 56 | return CR_FAILURE; |
| 57 | } |
| 58 | out.print("Scanning.\n"); |
| 59 | std::set <df::tiletype> seen; |
| 60 | for (auto iter = world->map.map_blocks.begin(); iter != world->map.map_blocks.end(); iter++) |
| 61 | { |
| 62 | df::map_block *block = *iter; |
| 63 | df::tiletype tt; |
| 64 | // for each tile in block |
| 65 | for (uint32_t x = 0; x < 16; x++) for (uint32_t y = 0; y < 16; y++) |
| 66 | { |
| 67 | tt = block->tiletype[x][y]; |
| 68 | const char * name = tileName(tt); |
| 69 | if(tileShape(tt) != tiletype_shape::NONE ) |
| 70 | continue; |
| 71 | if(name && strlen(name) != 0) |
| 72 | continue; |
| 73 | if(seen.count(tt)) |
| 74 | continue; |
| 75 | seen.insert(tt); |
| 76 | out.print("Found tile {} @ {} {} {}\n", ENUM_AS_STR(tt), block->map_pos.x + x, block->map_pos.y + y, block->map_pos.z); |
| 77 | } |
| 78 | } |
| 79 | return CR_OK; |
| 80 | } |