const Urho3D::IntRect ConfigManager::GetIntRect(const Urho3D::String& section, const Urho3D::String& parameter, const Urho3D::IntRect& defaultValue) { auto value = Get(section, parameter); if (value.GetType() == Urho3D::VAR_INTRECT) return value.GetIntRect(); if (value.GetType() == Urho3D::VAR_STRING) return Urho3D::ToIntRect(value.GetString()); // Parameter doesn't exist, or is a different type if (_saveDefaultParameters) { // Set back to default Set(section, parameter, defaultValue); } return defaultValue; }
template <> IntRect Variant::Get<IntRect>() const { return GetIntRect(); }
template <> const IntRect& Variant::Get<const IntRect&>() const { return GetIntRect(); }