本文整理汇总了C++中AddMember函数的典型用法代码示例。如果您正苦于以下问题:C++ AddMember函数的具体用法?C++ AddMember怎么用?C++ AddMember使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddMember函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: strlen
int CBlock::Write( int member_id, const char *member_data, CIcarus* icarus )
{
CBlockMember *bMember = new CBlockMember;
bMember->SetID( member_id );
bMember->SetData( member_data, icarus );
bMember->SetSize( strlen(member_data) + 1 );
AddMember( bMember );
return true;
}
开发者ID:Elfmagi,项目名称:OpenJK,代码行数:13,代码来源:BlockStream.cpp
示例2: time
bool Group::Create(ObjectGuid guid, const char* name)
{
m_leaderGuid = guid;
m_leaderName = name;
m_leaderLastOnline = time(nullptr);
m_groupType = isBattleGroup() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL;
if (m_groupType == GROUPTYPE_RAID)
_initRaidSubGroupsCounter();
m_lootMethod = GROUP_LOOT;
m_lootThreshold = ITEM_QUALITY_UNCOMMON;
m_masterLooterGuid = guid;
m_currentLooterGuid = guid; // used for round robin looter
if (!isBattleGroup())
{
m_Id = sObjectMgr.GenerateGroupId();
Player* leader = sObjectMgr.GetPlayer(guid);
Player::ConvertInstancesToGroup(leader, this, guid);
// store group in database
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM groups WHERE groupId ='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE groupId ='%u'", m_Id);
CharacterDatabase.PExecute("INSERT INTO groups(groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid) "
"VALUES('%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u')",
m_Id, m_leaderGuid.GetCounter(), m_mainTankGuid.GetCounter(), m_mainAssistantGuid.GetCounter(), uint32(m_lootMethod),
m_masterLooterGuid.GetCounter(), uint32(m_lootThreshold),
m_targetIcons[0].GetRawValue(), m_targetIcons[1].GetRawValue(),
m_targetIcons[2].GetRawValue(), m_targetIcons[3].GetRawValue(),
m_targetIcons[4].GetRawValue(), m_targetIcons[5].GetRawValue(),
m_targetIcons[6].GetRawValue(), m_targetIcons[7].GetRawValue(),
isRaidGroup());
}
if (!AddMember(guid, name))
return false;
if (!isBattleGroup())
CharacterDatabase.CommitTransaction();
_updateLeaderFlag();
return true;
}
开发者ID:Ghaster,项目名称:mangos-classic,代码行数:51,代码来源:Group.cpp
示例3: sizeof
int CBlock::Write( int member_id, vector_t member_data )
{
CBlockMember *bMember;
bMember = new CBlockMember;
bMember->SetID( member_id );
bMember->SetData( member_data );
bMember->SetSize( sizeof(vector_t) );
AddMember( bMember );
return true;
}
开发者ID:DavidZeise,项目名称:OpenJK,代码行数:14,代码来源:BlockStream.cpp
示例4: nsXBLProtoImplMethod
void
nsXBLContentSink::ConstructMethod(const PRUnichar **aAtts)
{
mMethod = nsnull;
const PRUnichar* name = nsnull;
if (FindValue(aAtts, nsGkAtoms::name, &name)) {
mMethod = new nsXBLProtoImplMethod(name);
}
if (mMethod) {
AddMember(mMethod);
}
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:14,代码来源:nsXBLContentSink.cpp
示例5: AddMember
bool Party::AddMember(const int aid, const RogueGame &roguegame) {
//めちゃくちゃ例外的な処理 4番目に無理やり冬(すぐ死ぬ)を入れてる
if (aid == 23) {
members[3] = make_shared<MyChara>(aid, actionlog, situation);
}
else {
for (int i = 0; i < maxmember; ++i) {
if (members[i] == NULL) {
return AddMember(aid, i, roguegame);
}
}
}
return false;
}
开发者ID:yumakmc,项目名称:cuigame,代码行数:14,代码来源:RogueGameParty.cpp
示例6: CreateRank
void Guild::create(uint64 lGuid, std::string gname)
{
Player *pl;
MemberSlot *newmember;
std::string rname;
pl = ObjectAccessor::Instance().FindPlayer(lGuid);
if(!pl) return;
leaderGuid = lGuid;
name = gname;
MOTD = "No message set.";
rname = "Guild Master";
CreateRank(rname,GR_RIGHT_ALL);
rname = "Officer";
CreateRank(rname,GR_RIGHT_ALL);
rname = "Veteran";
CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
rname = "Member";
CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
rname = "Initiate";
CreateRank(rname,GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
Log::getSingleton().outDebug("GUILD: creating guild %s to leader:%d", gname.c_str(), leaderGuid);
QueryResult *result = sDatabase.Query( "SELECT MAX(guildId) FROM guilds" );
if( result )
{
Id = (*result)[0].GetUInt32()+1;
delete result;
}
else Id = 1;
if(pl)
{
pl->SetInGuild(Id);
pl->SetRank( GR_GUILDMASTER );
}
newmember = new MemberSlot;
newmember->guid = leaderGuid;
newmember->RankId = GR_GUILDMASTER;
newmember->Pnote = "";
newmember->OFFnote = "";
AddMember(newmember);
SaveGuildToDB();
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:50,代码来源:Guild.cpp
示例7: sizeof
int CBlock::Write( int member_id, vec3_t member_data, CIcarus* icarus )
{
CBlockMember *bMember;
bMember = new CBlockMember;
bMember->SetID( member_id );
bMember->SetData( member_data, icarus );
bMember->SetSize( sizeof(vec3_t) );
AddMember( bMember );
return true;
}
开发者ID:DingoOz,项目名称:OpenJK,代码行数:14,代码来源:BlockStream.cpp
示例8: time
bool Guild::Create(Player* leader, std::string gname)
{
if (sGuildMgr.GetGuildByName(gname))
{ return false; }
WorldSession* lSession = leader->GetSession();
if (!lSession)
{ return false; }
m_LeaderGuid = leader->GetObjectGuid();
m_Name = gname;
GINFO.clear();
MOTD = "No message set.";
m_Id = sObjectMgr.GenerateGuildId();
// creating data
time_t now = time(0);
tm local = *(localtime(&now)); // dereference and assign
m_CreatedDay = local.tm_mday;
m_CreatedMonth = local.tm_mon + 1;
m_CreatedYear = local.tm_year + 1900;
DEBUG_LOG("GUILD: creating guild %s to leader: %s", gname.c_str(), m_LeaderGuid.GetString().c_str());
// gname already assigned to Guild::name, use it to encode string for DB
CharacterDatabase.escape_string(gname);
std::string dbGINFO = GINFO;
std::string dbMOTD = MOTD;
CharacterDatabase.escape_string(dbGINFO);
CharacterDatabase.escape_string(dbMOTD);
CharacterDatabase.BeginTransaction();
// CharacterDatabase.PExecute("DELETE FROM guild WHERE guildid='%u'", Id); - MAX(guildid)+1 not exist
CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guildid='%u'", m_Id);
CharacterDatabase.PExecute("INSERT INTO guild (guildid,name,leaderguid,info,motd,createdate,EmblemStyle,EmblemColor,BorderStyle,BorderColor,BackgroundColor) "
"VALUES('%u','%s','%u', '%s', '%s','" UI64FMTD "','%u','%u','%u','%u','%u')",
m_Id, gname.c_str(), m_LeaderGuid.GetCounter(), dbGINFO.c_str(), dbMOTD.c_str(), uint64(now), m_EmblemStyle, m_EmblemColor, m_BorderStyle, m_BorderColor, m_BackgroundColor);
CharacterDatabase.CommitTransaction();
CreateDefaultGuildRanks(lSession->GetSessionDbLocaleIndex());
// Used by Eluna
#ifdef ENABLE_ELUNA
sEluna->OnCreate(this, leader, gname.c_str());
#endif /* ENABLE_ELUNA */
return AddMember(m_LeaderGuid, (uint32)GR_GUILDMASTER);
}
开发者ID:billy1arm,项目名称:MangosMC,代码行数:49,代码来源:Guild.cpp
示例9: PIntRange
/* PIntRange: parse an integer range and add its members to s */
static void PIntRange(IntSet s)
{
int i,i1,i2;
i1 = GetInt(1,s.nMembers);
SkipSpaces();
if (ch == '-') {
ReadCh();
i2 = GetInt(1,s.nMembers);
}
else
i2=i1;
for (i=i1; i<=i2; i++)
AddMember(s,i);
}
开发者ID:deardaniel,项目名称:PizzaTest,代码行数:16,代码来源:HUtil.c
示例10: GUID_LOPART
bool ArenaTeam::Create(uint32 captainGuid, ArenaType type, std::string teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor)
{
// Check if arena type is valid
if (!IsArenaTypeValid(type))
return false;
// Check if captain is present
if (!sObjectMgr->GetPlayer(captainGuid))
return false;
// Check if arena team name is already taken
if (sArenaTeamMgr->GetArenaTeamByName(TeamName))
return false;
// Generate new arena team id
TeamId = sArenaTeamMgr->GenerateArenaTeamId();
// Assign member variables
CaptainGuid = captainGuid;
Type = type;
TeamName = teamName;
BackgroundColor = backgroundColor;
EmblemStyle = emblemStyle;
EmblemColor = emblemColor;
BorderStyle = borderStyle;
BorderColor = borderColor;
// Save arena team to db
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ARENA_TEAM);
stmt->setUInt32(0, TeamId);
stmt->setString(1, TeamName);
stmt->setUInt32(2, GUID_LOPART(CaptainGuid));
stmt->setUInt8(3, Type);
stmt->setUInt16(4, Stats.Rating);
stmt->setUInt32(5, BackgroundColor);
stmt->setUInt8(6, EmblemStyle);
stmt->setUInt32(7, EmblemColor);
stmt->setUInt8(8, BorderStyle);
stmt->setUInt32(9, BorderColor);
CharacterDatabase.Execute(stmt);
// Add captain as member
AddMember(CaptainGuid);
sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), GUID_LOPART(CaptainGuid));
return true;
}
开发者ID:sk3tche,项目名称:TrinityCore,代码行数:48,代码来源:ArenaTeam.cpp
示例11: assert
JSONValue JSONValue::CreateChild(const String& name, JSONValueType valueType)
{
assert(IsObject());
if (!IsObject())
return JSONValue::EMPTY;
Value jsonValue;
if (valueType == JSON_OBJECT)
jsonValue.SetObject();
else if (valueType == JSON_ARRAY)
jsonValue.SetArray();
AddMember(name, jsonValue);
return GetChild(name, valueType);
}
开发者ID:Boshin,项目名称:Urho3D,代码行数:16,代码来源:JSONValue.cpp
示例12: GUID_LOPART
bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string const& arenaTeamName,
uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor,
uint8 borderStyle, uint32 borderColor)
{
// Check if captain is present
if (!ObjectAccessor::FindPlayer(captainGuid))
return false;
// Check if arena team name is already taken
if (sArenaTeamMgr->GetArenaTeamByName(arenaTeamName))
return false;
// Generate new arena team id
TeamId = sArenaTeamMgr->GenerateArenaTeamId();
// Assign member variables
CaptainGuid = captainGuid;
Type = type;
TeamName = arenaTeamName;
BackgroundColor = backgroundColor;
EmblemStyle = emblemStyle;
EmblemColor = emblemColor;
BorderStyle = borderStyle;
BorderColor = borderColor;
uint32 captainLowGuid = GUID_LOPART(captainGuid);
// Save arena team to db
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
stmt->setUInt32(0, TeamId);
stmt->setString(1, TeamName);
stmt->setUInt32(2, captainLowGuid);
stmt->setUInt8(3, Type);
stmt->setUInt16(4, Stats.Rating);
stmt->setUInt32(5, BackgroundColor);
stmt->setUInt8(6, EmblemStyle);
stmt->setUInt32(7, EmblemColor);
stmt->setUInt8(8, BorderStyle);
stmt->setUInt32(9, BorderColor);
CharacterDatabase.Execute(stmt);
// Add captain as member
AddMember(CaptainGuid);
TC_LOG_DEBUG("bg.arena", "New ArenaTeam created [Id: %u, Name: %s] [Type: %u] [Captain low GUID: %u]", GetId(), GetName().c_str(), GetType(), captainLowGuid);
return true;
}
开发者ID:reon,项目名称:5.4.1,代码行数:46,代码来源:ArenaTeam.cpp
示例13: DSP_DEBUG_BREAK_IF
CParty::CParty(CBattleEntity* PEntity)
{
DSP_DEBUG_BREAK_IF(PEntity == NULL);
DSP_DEBUG_BREAK_IF(PEntity->PParty != NULL);
m_PartyID = PEntity->id;
m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;
m_PLeader = NULL;
m_PAlliance = NULL;
m_PSyncTarget = NULL;
m_PQuaterMaster = NULL;
AddMember(PEntity);
SetLeader(PEntity);
}
开发者ID:ZeDingo,项目名称:darkstar,代码行数:17,代码来源:party.cpp
示例14: DSP_DEBUG_BREAK_IF
CParty::CParty(CBattleEntity* PEntity)
{
DSP_DEBUG_BREAK_IF(PEntity == nullptr);
DSP_DEBUG_BREAK_IF(PEntity->PParty != nullptr);
m_PartyID = PEntity->id;
m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;
m_PartyNumber = 0;
m_PLeader = nullptr;
m_PAlliance = nullptr;
m_PSyncTarget = nullptr;
m_PQuaterMaster = nullptr;
m_EffectsChanged = false;
AddMember(PEntity);
SetLeader((char*)PEntity->name.c_str());
}
开发者ID:DerpStarProject,项目名称:darkstar,代码行数:18,代码来源:party.cpp
示例15: DSP_DEBUG_BREAK_IF
CParty::CParty(CBattleEntity* PEntity, Sql_t* sql)
{
DSP_DEBUG_BREAK_IF(PEntity == NULL);
DSP_DEBUG_BREAK_IF(PEntity->PParty != NULL);
m_PartyID = PEntity->id;
m_PartyType = PEntity->objtype == TYPE_PC ? PARTY_PCS : PARTY_MOBS;
m_PartyNumber = 0;
m_PLeader = NULL;
m_PAlliance = NULL;
m_PSyncTarget = NULL;
m_PQuaterMaster = NULL;
AddMember(PEntity, sql);
SetLeader((int8*)PEntity->name.c_str());
}
开发者ID:ERA-Found-It,项目名称:darkstar,代码行数:18,代码来源:party.cpp
示例16: dxf
void CmyDocument::ImportFromAutocad(CString sPath) {
RPOINTLIST list;
DXF dxf(sPath);
dxf.init(true);
dxf.read_lines(list);
SYSTEM system;
system.name = "GLOBAL";
system.rank = LEVEL3;
JOINT j1,j2;
POSITION pos = list.GetHeadPosition();
while(pos) {
j1.p = list.GetNext(pos);
j2.p = list.GetNext(pos);
system.grid[IUX].AddSorted(j1.p.x);
system.grid[IUY].AddSorted(j1.p.y);
system.grid[IUZ].AddSorted(j1.p.z);
system.grid[IUX].AddSorted(j2.p.x);
system.grid[IUY].AddSorted(j2.p.y);
system.grid[IUZ].AddSorted(j2.p.z);
AddMember(&j1,&j2);
}
*global = system;
/*views*/
CmyView* pView;
pos = GetFirstViewPosition();
while(pos) {
pView = (CmyView*) GetNextView(pos);
pView->force_diagram = INONE;
if(pView->view != VIEW_3D) {
GRIDLIST* pgrid = &global->grid[NORMGRID[pView->view]];
if(!pgrid->IsEmpty()) {
pView->position = pgrid->GetCount() - 1;
pView->pvalue = pgrid->GetAt(pgrid->FindIndex(pView->position));
}
}
pView->InitView();
}
UpdateAllViews(NULL);
/*close file*/
dxf.finish(true);
}
开发者ID:dshawul,项目名称:StAnD,代码行数:44,代码来源:AutoCad.cpp
示例17: Y_add_member
void Y_add_member(int nArgs)
{
Operand op;
IOStream *file;
long offset;
char *structName, *name;
StructDef *memType, *base;
Symbol *stack= sp-nArgs+1;
if (nArgs<5) YError("add_member requires at least five arguments");
file= YGetFile(stack++);
structName= YGetString(stack++);
offset= YGetInteger(stack++);
name= YGetString(stack++);
stack->ops->FormOperand(stack, &op);
if (op.ops==&structDefOps) memType= op.value;
else if (op.ops==&stringOps && !op.type.dims) {
char *typeName= ((char **)op.value)[0];
if (!HashFind(&file->structTable, typeName, 0L))
YError("5th argument refers to non-existent data type");
memType= file->structList[hashIndex];
} else {
YError("5th argument must be either string or struct definition");
memType= 0;
}
if (HashFind(&file->structTable, structName, 0L))
base= file->structList[hashIndex];
else
base= AddStruct(file, structName, 0L);
if (!base) YError("unable to create given struct_name in add_member");
nArgs-= 5;
stack++;
BuildDimList(stack, nArgs);
if (AddMember(base, offset, name, memType, tmpDims))
YError("add_member failed -- duplicate member name?");
Drop(nArgs);
}
开发者ID:MattWherry,项目名称:yorick,代码行数:43,代码来源:std2.c
示例18: RemoveChildren
void spInterFileContext::ParseContents( SourceParserPlugin* pPlugin )
{
mDeletionMarks.erase( mDeletionMarks.begin(), mDeletionMarks.end() );
RemoveChildren(); // clean up top-level context
mParser.SetPlugin( pPlugin );
for( size_t i = 0; i != m_Files.size(); ++i )
{
wxChar* s = (char*)(m_Contents[i].c_str());
spFile* pFCtx = mParser.Parse( s, s + m_Contents[i].length() );
pFCtx->m_FileName = m_Files[i];
AddMember( pFCtx );
}
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:19,代码来源:ifcontext.cpp
示例19: getter_AddRefs
void
nsXBLContentSink::ConstructProperty(const PRUnichar **aAtts)
{
const PRUnichar* name = nsnull;
const PRUnichar* readonly = nsnull;
const PRUnichar* onget = nsnull;
const PRUnichar* onset = nsnull;
nsCOMPtr<nsIAtom> prefix, localName;
for (; *aAtts; aAtts += 2) {
PRInt32 nameSpaceID;
nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
getter_AddRefs(localName), &nameSpaceID);
if (nameSpaceID != kNameSpaceID_None) {
continue;
}
// Is this attribute one of the ones we care about?
if (localName == nsGkAtoms::name) {
name = aAtts[1];
}
else if (localName == nsGkAtoms::readonly) {
readonly = aAtts[1];
}
else if (localName == nsGkAtoms::onget) {
onget = aAtts[1];
}
else if (localName == nsGkAtoms::onset) {
onset = aAtts[1];
}
}
if (name) {
// All of our pointers are now filled in. Construct our property with all of
// these parameters.
mProperty = new nsXBLProtoImplProperty(name, onget, onset, readonly);
if (mProperty) {
AddMember(mProperty);
}
}
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:42,代码来源:nsXBLContentSink.cpp
示例20: AddMember
void Group::Create(const uint64 &guid, const char * name)
{
m_leaderGuid = guid;
m_leaderName = name;
m_groupType = GROUPTYPE_NORMAL;
m_lootMethod = GROUP_LOOT;
AddMember(guid, name);
// store group in database
sDatabase.BeginTransaction();
sDatabase.PExecute("DELETE FROM `group` WHERE `leaderGuid`='%u'", GUID_LOPART(m_leaderGuid));
sDatabase.PExecute("DELETE FROM `group_member` WHERE `leaderGuid`='%u'", GUID_LOPART(m_leaderGuid));
sDatabase.PExecute("INSERT INTO `group`(`leaderGuid`,`lootMethod`,`looterGuid`,`icon1`,`icon2`,`icon3`,`icon4`,`icon5`,`icon6`,`icon7`,`icon8`,`isRaid`) VALUES('%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u',0)", GUID_LOPART(m_leaderGuid), m_lootMethod, GUID_LOPART(m_looterGuid), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7]);
for(vector<MemberSlot>::const_iterator citr=m_members.begin(); citr!=m_members.end(); citr++)
sDatabase.PExecute("INSERT INTO `group_member`(`leaderGuid`,`memberGuid`,`assistant`,`subgroup`) VALUES('%u','%u','%u','%u')", GUID_LOPART(m_leaderGuid), GUID_LOPART(citr->guid), (citr->assistant==1)?1:0, citr->group);
sDatabase.CommitTransaction();
}
开发者ID:Aion,项目名称:caldari,代码行数:20,代码来源:Group.cpp
注:本文中的AddMember函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论