| 206 | } |
| 207 | |
| 208 | unsigned char TileManager::providesCoverage(unsigned int level, int tile_x, int tile_y) { |
| 209 | std::map<int, std::map<int, unsigned char> >& cover_level = _coverage[level]; |
| 210 | if (cover_level.empty()) { |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | if (tile_x < 0 || tile_y < 0) { |
| 215 | for (std::map<int, std::map<int, unsigned char> >::iterator it_x = cover_level.begin(); it_x != cover_level.end(); ++it_x) { |
| 216 | for (std::map<int, unsigned char>::iterator it_y = it_x->second.begin(); it_y != it_x->second.end(); ++it_y) { |
| 217 | if (it_y->second != 2) { |
| 218 | return 0; |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | return 2; |
| 223 | } |
| 224 | |
| 225 | return cover_level[tile_x][tile_y]; |
| 226 | } |
| 227 | |
| 228 | bool TileManager::isCovered(unsigned int level, int tile_x, int tile_y) { |
| 229 | if (level > 0) { |