mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 13:39:40 +00:00
Use default objects for NavigatorStub methods result
This commit is contained in:
parent
ece111d05a
commit
8d2af94b75
4 changed files with 12 additions and 7 deletions
|
@ -191,7 +191,7 @@ namespace DetourNavigator
|
||||||
*/
|
*/
|
||||||
virtual std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const = 0;
|
virtual std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const = 0;
|
||||||
|
|
||||||
virtual Settings getSettings() const = 0;
|
virtual const Settings& getSettings() const = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace DetourNavigator
|
||||||
return mNavMeshManager.getNavMeshes();
|
return mNavMeshManager.getNavMeshes();
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings NavigatorImpl::getSettings() const
|
const Settings& NavigatorImpl::getSettings() const
|
||||||
{
|
{
|
||||||
return mSettings;
|
return mSettings;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace DetourNavigator
|
||||||
|
|
||||||
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override;
|
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override;
|
||||||
|
|
||||||
Settings getSettings() const override;
|
const Settings& getSettings() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings mSettings;
|
Settings mSettings;
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
|
|
||||||
namespace DetourNavigator
|
namespace DetourNavigator
|
||||||
{
|
{
|
||||||
struct NavigatorStub final : public Navigator
|
class NavigatorStub final : public Navigator
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
NavigatorStub() = default;
|
NavigatorStub() = default;
|
||||||
|
|
||||||
void addAgent(const osg::Vec3f& /*agentHalfExtents*/) override {}
|
void addAgent(const osg::Vec3f& /*agentHalfExtents*/) override {}
|
||||||
|
@ -65,7 +66,7 @@ namespace DetourNavigator
|
||||||
|
|
||||||
SharedNavMeshCacheItem getNavMesh(const osg::Vec3f& /*agentHalfExtents*/) const override
|
SharedNavMeshCacheItem getNavMesh(const osg::Vec3f& /*agentHalfExtents*/) const override
|
||||||
{
|
{
|
||||||
return SharedNavMeshCacheItem();
|
return mEmptyNavMeshCacheItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override
|
std::map<osg::Vec3f, SharedNavMeshCacheItem> getNavMeshes() const override
|
||||||
|
@ -73,10 +74,14 @@ namespace DetourNavigator
|
||||||
return std::map<osg::Vec3f, SharedNavMeshCacheItem>();
|
return std::map<osg::Vec3f, SharedNavMeshCacheItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings getSettings() const override
|
const Settings& getSettings() const override
|
||||||
{
|
{
|
||||||
return Settings {};
|
return mDefaultSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Settings mDefaultSettings {};
|
||||||
|
SharedNavMeshCacheItem mEmptyNavMeshCacheItem;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue