mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-26 00:05:52 +00:00
refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
using namespace nlohmann;
|
||||
using namespace IW5;
|
||||
using namespace ::attachment;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -394,14 +393,14 @@ namespace
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
bool JsonDumper::ShouldDump(XAssetInfo<WeaponAttachment>* asset)
|
||||
bool JsonDumperIW5::ShouldDump(XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
void JsonDumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset)
|
||||
{
|
||||
const auto assetFile = context.OpenAssetFile(GetJsonFileNameForAssetName(asset->m_name));
|
||||
|
||||
@@ -411,4 +410,4 @@ namespace IW5::attachment
|
||||
const JsonDumperImpl dumper(context, *assetFile);
|
||||
dumper.Dump(asset->Asset());
|
||||
}
|
||||
} // namespace IW5::attachment
|
||||
} // namespace attachment
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "Dumping/AbstractAssetDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5::attachment
|
||||
namespace attachment
|
||||
{
|
||||
class JsonDumper final : public AbstractAssetDumper<WeaponAttachment>
|
||||
class JsonDumperIW5 final : public AbstractAssetDumper<IW5::WeaponAttachment>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponAttachment>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponAttachment>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::WeaponAttachment>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::WeaponAttachment>* asset) override;
|
||||
};
|
||||
} // namespace IW5::attachment
|
||||
} // namespace attachment
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <unordered_set>
|
||||
|
||||
using namespace IW5;
|
||||
using namespace ::weapon;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -732,14 +731,14 @@ namespace
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
bool Dumper::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
bool DumperIW5::ShouldDump(XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dumper::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
void DumperIW5::DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset)
|
||||
{
|
||||
// TODO: only dump infostring fields when non-default
|
||||
|
||||
@@ -766,4 +765,4 @@ namespace IW5::weapon
|
||||
|
||||
DumpAccuracyGraphs(context, asset);
|
||||
}
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
|
||||
namespace IW5::weapon
|
||||
namespace weapon
|
||||
{
|
||||
class Dumper final : public AbstractAssetDumper<WeaponCompleteDef>
|
||||
class DumperIW5 final : public AbstractAssetDumper<IW5::WeaponCompleteDef>
|
||||
{
|
||||
protected:
|
||||
bool ShouldDump(XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<WeaponCompleteDef>* asset) override;
|
||||
bool ShouldDump(XAssetInfo<IW5::WeaponCompleteDef>* asset) override;
|
||||
void DumpAsset(AssetDumpingContext& context, XAssetInfo<IW5::WeaponCompleteDef>* asset) override;
|
||||
};
|
||||
} // namespace IW5::weapon
|
||||
} // namespace weapon
|
||||
|
||||
Reference in New Issue
Block a user