[core] Added RendererState::has{Image,Layer,Source}

This commit is contained in:
Bruno de Oliveira Abinader
2018-10-24 11:23:05 +03:00
parent 8e2214129e
commit 55710cbb67
5 changed files with 107 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ namespace mbgl {
class UpdateParameters;
/**
* RendererState acts as a Memento-like object that is able to extract data out of UpdateParameters (an opaque object
* RendererState acts as a Memento object that is able to extract data out of UpdateParameters (an opaque object
* from the public API perspective).
*/
class RendererState {
@@ -17,6 +17,14 @@ public:
// Obtains a CameraOptions out of a given UpdateParameters object.
static CameraOptions getCameraOptions(UpdateParameters&, const EdgeInsets& = {});
// Returns whether an image with the given ID exists from a given UpdateParamters object.
static bool hasImage(UpdateParameters&, const std::string& id);
// Returns whether a layer with the given ID exists from a given UpdateParamters object.
static bool hasLayer(UpdateParameters&, const std::string& id);
// Returns whether a source with the given ID exists from a given UpdateParamters object.
static bool hasSource(UpdateParameters&, const std::string& id);
};
} // namespace mbgl