本文整理汇总了C++中MemberInfo::setJoined方法的典型用法代码示例。如果您正苦于以下问题:C++ MemberInfo::setJoined方法的具体用法?C++ MemberInfo::setJoined怎么用?C++ MemberInfo::setJoined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberInfo
的用法示例。
在下文中一共展示了MemberInfo::setJoined方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void cGuild::load( const QSqlQuery& result )
{
serial_ = result.value( 0 ).toInt();
name_ = result.value( 1 ).toString();
abbreviation_ = result.value( 2 ).toString();
charta_ = result.value( 3 ).toString();
website_ = result.value( 4 ).toString();
alignment_ = ( eAlignment ) result.value( 5 ).toInt();
leader_ = dynamic_cast<P_PLAYER>( World::instance()->findChar( result.value( 6 ).toInt() ) );
founded_.setTime_t( result.value( 7 ).toInt() );
guildstone_ = World::instance()->findItem( result.value( 8 ).toInt() );
// Load members and canidates
QSqlQuery members( QString( "SELECT player,showsign,guildtitle,joined FROM guilds_members WHERE guild = %1" ).arg( serial_ ) );
while ( members.next() )
{
P_PLAYER player = dynamic_cast<P_PLAYER>( World::instance()->findChar( members.value( 0 ).toInt() ) );
if ( player )
{
player->setGuild( this );
members_.append( player );
MemberInfo* info = new MemberInfo;
info->setShowSign( members.value( 1 ).toInt() != 0 );
info->setGuildTitle( members.value( 2 ).toString() );
info->setJoined( members.value( 3 ).toInt() );
memberinfo_.insert( player, info );
}
}
QSqlQuery canidates( QString( "SELECT player FROM guilds_canidates WHERE guild = %1" ).arg( serial_ ) );
while ( canidates.next() )
{
P_PLAYER player = dynamic_cast<P_PLAYER>( World::instance()->findChar( canidates.value( 0 ).toInt() ) );
if ( player )
{
player->setGuild( this );
canidates_.append( player );
}
}
// Clear the leader if he's not a member of the guild
if ( !members_.contains( leader_ ) )
{
leader_ = 0;
}
Guilds::instance()->registerGuild( this );
QSqlQuery allies( QString( "SELECT ally FROM guilds_allies WHERE guild = %1" ).arg( serial_ ) );
while ( allies.next() )
{
allies_.append( allies.value( 0 ).toInt() );
}
QSqlQuery enemies( QString( "SELECT enemy FROM guilds_enemies WHERE guild = %1" ).arg( serial_ ) );
while ( enemies.next() )
{
enemies_.append( enemies.value( 0 ).toInt() );
}
}