Implement Style::isLoaded

This commit is contained in:
John Firebaugh
2015-04-21 17:36:50 -07:00
parent 6c7a01a503
commit ec7588f1fd
5 changed files with 37 additions and 1 deletions

View File

@@ -118,6 +118,20 @@ Source::Source()
Source::~Source() {}
bool Source::isLoaded() const {
if (!loaded) {
return false;
}
for (const auto& tile : tiles) {
if (tile.second->data->state != TileData::State::parsed) {
return false;
}
}
return true;
}
// Note: This is a separate function that must be called exactly once after creation
// The reason this isn't part of the constructor is that calling shared_from_this() in
// the constructor fails.