void EngineSettings::validate() const { if (m_defaultfontpath == "") { throw NotSet("Path for default font is not set"); } std::string::size_type loc = m_defaultfontpath.find(".ttf", 0); if ((loc == std::string::npos) && (m_defaultfontglyphs == "")) { throw NotSet("Glyphs for default font are not set"); } }
ModelCoordinate Location::getLayerCoordinates(const Layer* layer) const { if (!isValid(layer)) { throw NotSet(INVALID_LAYER_GET); } if (layer == m_layer) { return getLayerCoordinates(); } CellGrid* cg1 = m_layer->getCellGrid(); CellGrid* cg2 = layer->getCellGrid(); return cg2->toLayerCoordinates(cg1->toMapCoordinates(m_exact_layer_coords)); }
void Location::setMapCoordinates(const ExactModelCoordinate& coordinates) { if (!isValid()) { throw NotSet(INVALID_LAYER_SET); } m_exact_layer_coords = m_layer->getCellGrid()->toExactLayerCoordinates(coordinates); }
void Location::setExactLayerCoordinates(const ExactModelCoordinate& coordinates) { if (!isValid()) { throw NotSet(INVALID_LAYER_SET); } m_exact_layer_coords = coordinates; }