Exemplo n.º 1
0
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");
    }
}
Exemplo n.º 2
0
	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));
	}
Exemplo n.º 3
0
	void Location::setMapCoordinates(const ExactModelCoordinate& coordinates) {
		if (!isValid()) {
			throw NotSet(INVALID_LAYER_SET);
		}
		m_exact_layer_coords = m_layer->getCellGrid()->toExactLayerCoordinates(coordinates);
	}
Exemplo n.º 4
0
	void Location::setExactLayerCoordinates(const ExactModelCoordinate& coordinates) {
		if (!isValid()) {
			throw NotSet(INVALID_LAYER_SET);
		}
		m_exact_layer_coords = coordinates;
	}