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