mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-28 12:40:06 +00:00
Support parent, type and value fields in esmtool for ESM4
This commit is contained in:
parent
e7acced5e9
commit
d541436b15
@ -97,6 +97,10 @@ namespace EsmTool
|
||||
std::cout << "\n Id: " << value.mId;
|
||||
if constexpr (ESM4::hasFlags<T>)
|
||||
std::cout << "\n Record flags: " << recordFlags(value.mFlags);
|
||||
if constexpr (ESM4::hasParentFormId<T>)
|
||||
std::cout << "\n ParentFormId: " << value.mParentFormId;
|
||||
if constexpr (ESM4::hasParent<T>)
|
||||
std::cout << "\n Parent: " << value.mParent;
|
||||
if constexpr (ESM4::hasEditorId<T>)
|
||||
std::cout << "\n EditorId: " << value.mEditorId;
|
||||
if constexpr (ESM4::hasModel<T>)
|
||||
@ -105,6 +109,10 @@ namespace EsmTool
|
||||
std::cout << "\n Nif:" << WriteArray("\n - ", value.mNif);
|
||||
if constexpr (ESM4::hasKf<T>)
|
||||
std::cout << "\n Kf:" << WriteArray("\n - ", value.mKf);
|
||||
if constexpr (ESM4::hasType<T>)
|
||||
std::cout << "\n Type: " << value.mType;
|
||||
if constexpr (ESM4::hasValue<T>)
|
||||
std::cout << "\n Value: " << value.mValue;
|
||||
std::cout << '\n';
|
||||
}
|
||||
|
||||
|
@ -194,6 +194,7 @@ add_component_dir (esm4
|
||||
reference
|
||||
script
|
||||
readerutils
|
||||
typetraits
|
||||
)
|
||||
|
||||
add_component_dir (misc
|
||||
|
@ -81,4 +81,4 @@ namespace ESM4
|
||||
};
|
||||
}
|
||||
|
||||
#endif // !OPENMW_COMPONENTS_ESM4_READERUTILS
|
||||
#endif // OPENMW_COMPONENTS_ESM4_READERUTILS
|
||||
|
@ -31,6 +31,32 @@ namespace ESM4
|
||||
template <class T>
|
||||
inline constexpr bool hasId = HasId<T>::value;
|
||||
|
||||
template <class T, class = std::void_t<>>
|
||||
struct HasParentFormId : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct HasParentFormId<T, std::void_t<decltype(T::mParentFormId)>> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool hasParentFormId = HasParentFormId<T>::value;
|
||||
|
||||
template <class T, class = std::void_t<>>
|
||||
struct HasParent : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct HasParent<T, std::void_t<decltype(T::mParent)>> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool hasParent = HasParent<T>::value;
|
||||
|
||||
template <class T, class = std::void_t<>>
|
||||
struct HasFlags : std::false_type
|
||||
{
|
||||
@ -95,6 +121,32 @@ namespace ESM4
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool hasKf = HasKf<T>::value;
|
||||
|
||||
template <class T, class = std::void_t<>>
|
||||
struct HasType : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct HasType<T, std::void_t<decltype(T::mType)>> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool hasType = HasType<T>::value;
|
||||
|
||||
template <class T, class = std::void_t<>>
|
||||
struct HasValue : std::false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct HasValue<T, std::void_t<decltype(T::mValue)>> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool hasValue = HasValue<T>::value;
|
||||
}
|
||||
|
||||
#endif // OPENMW_COMPONENTS_ESM4_TYPETRAITS
|
||||
|
Loading…
x
Reference in New Issue
Block a user