mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* trigger tidy * copy&move BApplicPtr obj always commit tidy changes * move PolObject * fix house add_component * Automated clang-tidy change: performance-unnecessary-copy-initialization,performance-unnecessary-value-param * Revert "Automated clang-tidy change: performance-unnecessary-copy-initialization,performance-unnecessary-value-param" This reverts commit bb6aab13dbdfa4aaf420cdaafaf22940f241fc5b. * performance-unnecessary-value-param gives some weird suggestions * Automated clang-tidy change: performance-unnecessary-copy-initialization * minor performance improvements * added used tidy check * missing dependency * renamed build so its no longer requires? * better add docs for the sneaky fix * silence pr check, not all headers can be compiled seperatly --------- Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#include "guildscrobj.h"
|
|
|
|
#include "../clib/stlutil.h"
|
|
#include "guilds.h"
|
|
#include <stddef.h>
|
|
#include <string>
|
|
|
|
|
|
namespace Pol::Module
|
|
{
|
|
using namespace Bscript;
|
|
|
|
BApplicObjType guild_type;
|
|
|
|
EGuildRefObjImp::EGuildRefObjImp( Core::GuildRef gref )
|
|
: PolApplicObj<Core::GuildRef>( &guild_type, std::move( gref ) ) {};
|
|
|
|
const char* EGuildRefObjImp::typeOf() const
|
|
{
|
|
return "GuildRef";
|
|
}
|
|
u8 EGuildRefObjImp::typeOfInt() const
|
|
{
|
|
return OTGuildRef;
|
|
}
|
|
|
|
BObjectImp* EGuildRefObjImp::copy() const
|
|
{
|
|
return new EGuildRefObjImp( obj_ );
|
|
}
|
|
|
|
bool EGuildRefObjImp::isTrue() const
|
|
{
|
|
return ( !obj_->_disbanded );
|
|
}
|
|
|
|
bool EGuildRefObjImp::operator==( const BObjectImp& objimp ) const
|
|
{
|
|
if ( objimp.isa( BObjectImp::OTApplicObj ) )
|
|
{
|
|
const BApplicObjBase* aob =
|
|
Clib::explicit_cast<const BApplicObjBase*, const BObjectImp*>( &objimp );
|
|
|
|
if ( aob->object_type() == &guild_type )
|
|
{
|
|
const EGuildRefObjImp* guildref_imp =
|
|
Clib::explicit_cast<const EGuildRefObjImp*, const BApplicObjBase*>( aob );
|
|
|
|
return ( guildref_imp->obj_->_guildid == obj_->_guildid );
|
|
}
|
|
return false;
|
|
}
|
|
if ( objimp.isa( BObjectImp::OTBoolean ) )
|
|
return isTrue() == static_cast<const BBoolean&>( objimp ).isTrue();
|
|
return false;
|
|
}
|
|
|
|
|
|
} // namespace Pol::Module
|