60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
|
/******************************************************************************/
|
||
|
/* MODDING SYSTEM - INLINE CODE ***********************************************/
|
||
|
/******************************************************************************/
|
||
|
|
||
|
#ifndef _H_LW_LIB_INLINE_MODS
|
||
|
#define _H_LW_LIB_INLINE_MODS
|
||
|
#include <lw/lib/Mods.hh>
|
||
|
namespace lw {
|
||
|
|
||
|
|
||
|
/*= T_ModIdentifier ==========================================================*/
|
||
|
|
||
|
inline bool T_ModIdentifier::operator ==(
|
||
|
T_ModIdentifier const& other ) const noexcept
|
||
|
{
|
||
|
return &other == this || ( name == other.name
|
||
|
&& version == other.version );
|
||
|
}
|
||
|
|
||
|
inline bool T_ModIdentifier::operator !=(
|
||
|
T_ModIdentifier const& other ) const noexcept
|
||
|
{
|
||
|
return &other != this && ( name != other.name
|
||
|
|| version != other.version );
|
||
|
}
|
||
|
|
||
|
inline M_DEFINE_HASH( T_ModIdentifier )
|
||
|
{
|
||
|
return ComputeHash( item.name ) * 47 + item.version;
|
||
|
}
|
||
|
|
||
|
inline M_DEFINE_COMPARATOR( T_ModIdentifier )
|
||
|
{
|
||
|
return a.compare( b );
|
||
|
}
|
||
|
|
||
|
inline M_LSHIFT_OP( T_StringBuilder , T_ModIdentifier const& )
|
||
|
{
|
||
|
obj << value.name << ':' << value.version;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
|
||
|
/*= T_ModInfo ================================================================*/
|
||
|
|
||
|
inline bool T_ModInfo::isUserInterface( ) const noexcept
|
||
|
{
|
||
|
return type == E_ModType::UI;
|
||
|
}
|
||
|
|
||
|
inline M_LSHIFT_OP( T_StringBuilder , T_ModInfo const& )
|
||
|
{
|
||
|
obj << value.identifier << '.' << value.revision;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
#endif // _H_LW_LIB_INLINE_MODS
|