您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetId函数代码示例

51自学网 2021-06-01 21:09:13
  C++
这篇教程C++ GetId函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetId函数的具体用法?C++ GetId怎么用?C++ GetId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetId函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Load

 bool Load() {     _decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;     return true; }
开发者ID:AwkwardDev,项目名称:PlaygroundCore,代码行数:5,


示例2: and

void wxTopLevelWindowGTK::GtkOnSize(){    // avoid recursions    if (m_resizing) return;    m_resizing = true;    if ( m_wxwindow == NULL ) return;    /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses       wxWindow::Create to create it's GTK equivalent. m_mainWidget is only       set in wxFrame::Create so it is used to check what kind of frame we       have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we       skip the part which handles m_frameMenuBar, m_frameToolBar and (most       importantly) m_mainWidget */    int minWidth = GetMinWidth(),        minHeight = GetMinHeight(),        maxWidth = GetMaxWidth(),        maxHeight = GetMaxHeight();#ifdef __WXGPE__    // GPE's window manager doesn't like size hints    // at all, esp. when the user has to use the    // virtual keyboard.    minWidth = -1;    minHeight = -1;    maxWidth = -1;    maxHeight = -1;#endif    if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;    if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;    if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;    if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;    if (m_mainWidget)    {        // m_mainWidget holds the menubar, the toolbar and the client area,        // which is represented by m_wxwindow.        int client_x = m_miniEdge;        int client_y = m_miniEdge + m_miniTitle;        int client_w = m_width - 2*m_miniEdge;        int client_h = m_height - 2*m_miniEdge - m_miniTitle;        if (client_w < 0)            client_w = 0;        if (client_h < 0)            client_h = 0;        // Let the parent perform the resize        gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),                              m_wxwindow,                              client_x, client_y, client_w, client_h );    }    else    {        // If there is no m_mainWidget between m_widget and m_wxwindow there        // is no need to set the size or position of m_wxwindow.    }    m_sizeSet = true;    // send size event to frame    wxSizeEvent event( wxSize(m_width,m_height), GetId() );    event.SetEventObject( this );    GetEventHandler()->ProcessEvent( event );    m_resizing = false;}
开发者ID:SCP-682,项目名称:Cities3D,代码行数:68,


示例3: while

void ArenaTeam::Disband(WorldSession* session){    // Remove all members from arena team    while (!Members.empty())        DelMember(Members.front().Guid, false);    // Broadcast update    if (session)    {        BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");        if (Player *player = session->GetPlayer())            sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());    }    // Update database    SQLTransaction trans = CharacterDatabase.BeginTransaction();    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM);    stmt->setUInt32(0, TeamId);    trans->Append(stmt);    stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBERS);    stmt->setUInt32(0, TeamId);    trans->Append(stmt);    CharacterDatabase.CommitTransaction(trans);    // Remove arena team from ObjectMgr    sArenaTeamMgr->RemoveArenaTeam(TeamId);}
开发者ID:Alluring,项目名称:TrinityCore,代码行数:31,


示例4: instance

/*- return the right instance for the object, based on its InstanceId- create the instance if it's not created already- the player is not actually added to the instance (only in InstanceMap::Add)*/Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player){    if (GetId() != mapId || !player)        return NULL;    Map* map = NULL;    uint32 newInstanceId = 0;                       // instanceId of the resulting map    if (IsBattlegroundOrArena())    {        // instantiate or find existing bg map for player        // the instance id is set in battlegroundid        newInstanceId = player->GetBattlegroundId();        if (!newInstanceId)            return NULL;        map = sMapMgr->FindMap(mapId, newInstanceId);        if (!map)        {            if (Battleground* bg = player->GetBattleground())                map = CreateBattleground(newInstanceId, bg);            else            {                player->TeleportToBGEntryPoint();                return NULL;            }        }    }    else    {        InstancePlayerBind* pBind = player->GetBoundInstance(GetId(), player->GetDifficulty(IsRaid()));        InstanceSave* pSave = pBind ? pBind->save : NULL;        // the player's permanent player bind is taken into consideration first        // then the player's group bind and finally the solo bind.        if (!pBind || !pBind->perm)        {            InstanceGroupBind* groupBind = NULL;            Group* group = player->GetGroup();            // use the player's difficulty setting (it may not be the same as the group's)            if (group)            {                groupBind = group->GetBoundInstance(this);                if (groupBind)                    pSave = groupBind->save;            }        }        if (pSave)        {            // solo/perm/group            newInstanceId = pSave->GetInstanceId();            map = FindInstanceMap(newInstanceId);            // it is possible that the save exists but the map doesn't            if (!map)                map = CreateInstance(newInstanceId, pSave, pSave->GetDifficulty());        }        else        {            // if no instanceId via group members or instance saves is found            // the instance will be created for the first time            newInstanceId = sMapMgr->GenerateInstanceId();            Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());            //Seems it is now possible, but I do not know if it should be allowed            //ASSERT(!FindInstanceMap(NewInstanceId));            map = FindInstanceMap(newInstanceId);            if (!map)                map = CreateInstance(newInstanceId, NULL, diff);        }    }    return map;}
开发者ID:3DViking,项目名称:MistCore,代码行数:78,


示例5: THROW_ARGOSEXCEPTION

 void CKinematics2DEngine::RemoveControllableEntity(const std::string& str_id) {   TControllableEntityMap::iterator it = m_tControllableEntities.find(str_id);   if(it != m_tControllableEntities.end()) {     m_tControllableEntities.erase(it);   }   else {     THROW_ARGOSEXCEPTION("Controllable entity id /"" << str_id << "/" not found in kinematics 2D engine /"" << GetId() << "/"");   } }
开发者ID:EduardoFF,项目名称:argos2-RoboNetSim,代码行数:9,


示例6: GetSlotByType

uint8 ArenaTeam::GetSlot() const{    uint8 slot = GetSlotByType(GetType());    if(slot >= MAX_ARENA_SLOT)    {        sLog.outError("Unknown arena team type %u for arena team %u", uint32(GetType()), GetId());        return 0;                                           // better return existed slot to prevent untelated data curruption    }    return slot;}
开发者ID:gladden,项目名称:mangos,代码行数:11,


示例7: switch

void ArenaTeam::SetStats(uint32 stat_type, uint32 value){    switch(stat_type)    {        case STAT_TYPE_RATING:            stats.rating = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET rating = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        case STAT_TYPE_GAMES_WEEK:            stats.games_week = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET games = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        case STAT_TYPE_WINS_WEEK:            stats.wins_week = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET wins = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        case STAT_TYPE_GAMES_SEASON:            stats.games_season = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET played = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        case STAT_TYPE_WINS_SEASON:            stats.wins_season = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET wins2 = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        case STAT_TYPE_RANK:            stats.rank = value;            CharacterDatabase.PExecute("UPDATE arena_team_stats SET rank = '%u' WHERE arenateamid = '%u'", value, GetId());            break;        default:            sLog.outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type);            break;    }}
开发者ID:Kiper,项目名称:mangos,代码行数:33,


示例8: wxTextCtrl

wxObject* wxsTextCtrl::OnBuildPreview(wxWindow* Parent,long Flags){    wxTextCtrl* Preview = new wxTextCtrl(Parent,GetId(),Text,Pos(Parent),Size(Parent),Style());    return SetupWindow(Preview,Flags);}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:5,


示例9: Register

void FShaderResource::Register(){	ShaderResourceIdMap.Add(GetId(), this);}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:4,


示例10: DG_TRACKTIME_NAMED

void dgWorldBase::CalculateJointForces(const dgBodyCluster& cluster, dgBodyInfo* const bodyArray, dgJointInfo* const jointArray, dgFloat32 timestep){	DG_TRACKTIME_NAMED(GetId());	dgSolver::CalculateJointForces(cluster, bodyArray, jointArray, timestep);}
开发者ID:Hurleyworks,项目名称:newton-dynamics,代码行数:5,


示例11: AddMember

bool ArenaTeam::Create(ObjectGuid captainGuid, uint8 type, std::string const& teamName, 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(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;    uint32 captainLowGuid = captainGuid.GetCounter();    // 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:GlassFace,项目名称:XC_CORE,代码行数:44,


示例12: GetById

	FileEditor* GetById(int ID) { return GetId()==ID?this:nullptr; }
开发者ID:chapgaga,项目名称:farmanager,代码行数:1,


示例13: GetId

//// Return the id for calling Win32 API functions//int wxMenuItem::GetRealId() const{    return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();} // end of wxMenuItem::GetRealId
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:7,


示例14: EndResizing

//.........这里部分代码省略.........            return;    }    // find if the event is over a column at all    bool onSeparator;    const unsigned col = mevent.Leaving()                            ? (onSeparator = false, COL_NONE)                            : FindColumnAtPoint(xLogical, &onSeparator);    // update the highlighted column if it changed    if ( col != m_hover )    {        const unsigned hoverOld = m_hover;        m_hover = col;        RefreshColIfNotNone(hoverOld);        RefreshColIfNotNone(m_hover);    }    // update mouse cursor as it moves around    if ( mevent.Moving() )    {        SetCursor(onSeparator ? wxCursor(wxCURSOR_SIZEWE) : wxNullCursor);        return;    }    // all the other events only make sense when they happen over a column    if ( col == COL_NONE )        return;    // enter various dragging modes on left mouse press    if ( mevent.LeftDown() )    {        if ( onSeparator )        {            // start resizing the column            wxASSERT_MSG( !IsResizing(), "reentering column resize mode?" );            StartOrContinueResizing(col, xPhysical);        }        else // on column itself        {            // start dragging the column            wxASSERT_MSG( !IsReordering(), "reentering column move mode?" );            StartReordering(col, xPhysical);        }        return;    }    // determine the type of header event corresponding to click events    wxEventType evtType = wxEVT_NULL;    const bool click = mevent.ButtonUp(),               dblclk = mevent.ButtonDClick();    if ( click || dblclk )    {        switch ( mevent.GetButton() )        {            case wxMOUSE_BTN_LEFT:                // treat left double clicks on separator specially                if ( onSeparator && dblclk )                {                    evtType = wxEVT_HEADER_SEPARATOR_DCLICK;                }                else // not double click on separator                {                    evtType = click ? wxEVT_HEADER_CLICK                                    : wxEVT_HEADER_DCLICK;                }                break;            case wxMOUSE_BTN_RIGHT:                evtType = click ? wxEVT_HEADER_RIGHT_CLICK                                : wxEVT_HEADER_RIGHT_DCLICK;                break;            case wxMOUSE_BTN_MIDDLE:                evtType = click ? wxEVT_HEADER_MIDDLE_CLICK                                : wxEVT_HEADER_MIDDLE_DCLICK;                break;            default:                // ignore clicks from other mouse buttons                ;        }    }    if ( evtType == wxEVT_NULL )        return;    wxHeaderCtrlEvent event(evtType, GetId());    event.SetEventObject(this);    event.SetColumn(col);    if ( GetEventHandler()->ProcessEvent(event) )        mevent.Skip(false);}
开发者ID:chromylei,项目名称:third_party,代码行数:101,


示例15: MSWFromNativeIdx

//.........这里部分代码省略.........                // prevent the column from being shrunk beneath its min width                width = nmhdr->pitem->cxy;                if ( width < GetColumn(idx).GetMinWidth() )                {                    // don't generate any events and prevent the change from                    // happening                    veto = true;                }                else // width is acceptable                {                    // generate the resizing event from here as we don't seem                    // to be getting HDN_TRACK events at all, at least with                    // comctl32.dll v6                    evtType = wxEVT_COMMAND_HEADER_RESIZING;                }            }            break;        // column reordering events        // ------------------------        case HDN_BEGINDRAG:            // Windows sometimes sends us events with invalid column indices            if ( nmhdr->iItem == -1 )                break;            // column must have the appropriate flag to be draggable            if ( !GetColumn(idx).IsReorderable() )            {                veto = true;                break;            }            evtType = wxEVT_COMMAND_HEADER_BEGIN_REORDER;            break;        case HDN_ENDDRAG:            wxASSERT_MSG( nmhdr->pitem->mask & HDI_ORDER, "should have order" );            order = nmhdr->pitem->iOrder;            // we also get messages with invalid order when column reordering            // is cancelled (e.g. by pressing Esc)            if ( order == -1 )                break;            order = MSWFromNativeOrder(order);            evtType = wxEVT_COMMAND_HEADER_END_REORDER;            break;        case NM_RELEASEDCAPTURE:            evtType = wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED;            break;    }    // do generate the corresponding wx event    if ( evtType != wxEVT_NULL )    {        wxHeaderCtrlEvent event(evtType, GetId());        event.SetEventObject(this);        event.SetColumn(idx);        event.SetWidth(width);        if ( order != -1 )            event.SetNewOrder(order);        const bool processed = GetEventHandler()->ProcessEvent(event);        if ( processed && !event.IsAllowed() )            veto = true;        if ( !veto )        {            // special post-processing for HDN_ENDDRAG: we need to update the            // internal column indices array if this is allowed to go ahead as            // the native control is going to reorder its columns now            if ( evtType == wxEVT_COMMAND_HEADER_END_REORDER )                MoveColumnInOrderArray(m_colIndices, idx, order);            if ( processed )            {                // skip default processing below                return true;            }        }    }    if ( veto )    {        // all of HDN_BEGIN{DRAG,TRACK}, HDN_TRACK and HDN_ITEMCHANGING        // interpret TRUE return value as meaning to stop the control        // default handling of the message        *result = TRUE;        return true;    }    return wxHeaderCtrlBase::MSWOnNotify(idCtrl, lParam, result);}
开发者ID:beanhome,项目名称:dev,代码行数:101,


示例16: Deregister

void FShader::Deregister(){	Type->GetShaderIdMap().Remove(GetId());}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:4,


示例17: switch

bool wxComboBox::MSWCommand(WXUINT param, WXWORD id){    int sel = -1;    wxString value;    switch ( param )    {        case CBN_DROPDOWN:            // remember the last selection, just as wxChoice does            m_lastAcceptedSelection = GetCurrentSelection();            {                wxCommandEvent event(wxEVT_COMBOBOX_DROPDOWN, GetId());                event.SetEventObject(this);                ProcessCommand(event);            }            break;        case CBN_CLOSEUP:            // Do the same thing as in wxChoice but using different event type.            if ( m_pendingSelection != wxID_NONE )            {                SendSelectionChangedEvent(wxEVT_COMBOBOX);                m_pendingSelection = wxID_NONE;            }            {                wxCommandEvent event(wxEVT_COMBOBOX_CLOSEUP, GetId());                event.SetEventObject(this);                ProcessCommand(event);            }            break;        case CBN_SELENDOK:#ifndef __SMARTPHONE__            // we need to reset this to prevent the selection from being undone            // by wxChoice, see wxChoice::MSWCommand() and comments there            m_lastAcceptedSelection = wxID_NONE;#endif            // set these variables so that they could be also fixed in            // CBN_EDITCHANGE below            sel = GetSelection();            value = GetStringSelection();            // this string is going to become the new combobox value soon but            // we need it to be done right now, otherwise the event handler            // could get a wrong value when it calls our GetValue()            ::SetWindowText(GetHwnd(), value.t_str());            SendSelectionChangedEvent(wxEVT_COMBOBOX);            // fall through: for compatibility with wxGTK, also send the text            // update event when the selection changes (this also seems more            // logical as the text does change)        case CBN_EDITCHANGE:            if ( m_allowTextEvents )            {                wxCommandEvent event(wxEVT_TEXT, GetId());                // if sel != -1, value was already initialized above                if ( sel == -1 )                {                    value = wxGetWindowText(GetHwnd());                }                event.SetString(value);                InitCommandEventWithItems(event, sel);                ProcessCommand(event);            }            break;        default:            return wxChoice::MSWCommand(param, id);    }    // skip wxChoice version as it would generate its own events for    // CBN_SELENDOK and also interfere with our handling of CBN_DROPDOWN    return true;}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:80,


示例18: wxFileName

void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe ){    wxString        sep = wxFileName().GetPathSeparator();    wxString        fullFileName = GetFileName();    wxTreeItemId    id = GetId();    KICAD_MANAGER_FRAME* frame = (KICAD_MANAGER_FRAME*) Pgm().App().GetTopWindow();    switch( GetType() )    {    case TREE_PROJECT:        break;    case TREE_DIRECTORY:        m_parent->Toggle( id );        break;    case TREE_SCHEMA:        if( fullFileName == frame->SchFileName() )        {            // the project's schematic is opened using the *.kiface as part of this process.            frame->RunEeschema( fullFileName );        }        else        {            // schematics not part of the project are opened in a separate process.            frame->Execute( m_parent, EESCHEMA_EXE, fullFileName );        }        break;    case TREE_LEGACY_PCB:    case TREE_SEXP_PCB:        if( fullFileName == frame->PcbFileName() || fullFileName == frame->PcbLegacyFileName() )        {            // the project's BOARD is opened using the *.kiface as part of this process.            frame->RunPcbNew( fullFileName );        }        else        {            // boards not part of the project are opened in a separate process.            frame->Execute( m_parent, PCBNEW_EXE, fullFileName );        }        break;    case TREE_GERBER:        frame->Execute( m_parent, GERBVIEW_EXE, fullFileName );        break;    case TREE_PDF:        AddDelimiterString( fullFileName );        OpenPDF( fullFileName );        break;    case TREE_NET:        frame->Execute( m_parent, CVPCB_EXE, fullFileName );        break;    case TREE_TXT:        {            wxString editorname = Pgm().GetEditorName();            if( !editorname.IsEmpty() )                frame->Execute( m_parent, editorname, fullFileName );        }        break;    case TREE_PAGE_LAYOUT_DESCR:        frame->Execute( m_parent, PL_EDITOR_EXE, fullFileName );        break;    default:        AddDelimiterString( fullFileName );        OpenFile( fullFileName );        break;    }}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:76,


示例19: GetSlot

void ArenaTeam::DelMember(uint64 guid){    for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)    {        if (itr->guid == guid)        {            members.erase(itr);            break;        }    }    Player *player = objmgr.GetPlayer(guid);    if(player)    {        player->SetInArenaTeam(0, GetSlot());        player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);        // delete all info regarding this team        for(int i = 0; i < 6; ++i)        {            player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0);        }    }    CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));}
开发者ID:Kiper,项目名称:mangos,代码行数:26,


示例20: GetName

void ArenaTeam::DelMember(ObjectGuid guid){    for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)    {        if (itr->guid == guid)        {            m_members.erase(itr);            break;        }    }    if(Player *player = sObjectMgr.GetPlayer(guid))    {        player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);        // delete all info regarding this team        for(int i = 0; i < ARENA_TEAM_END; ++i)            player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);    }    CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), guid.GetCounter());}
开发者ID:TheX,项目名称:mangos,代码行数:21,


示例21: GetId

void ArenaTeam::SaveToDB(){    // save team and member stats to db    // called after a match has ended, or when calculating arena_points    CharacterDatabase.PExecute("UPDATE arena_team_stats SET rating = '%u',games = '%u',played = '%u',rank = '%u',wins = '%u',wins2 = '%u' WHERE arenateamid = '%u'", stats.rating, stats.games_week, stats.games_season, stats.rank, stats.wins_week, stats.wins_season, GetId());    for(MemberList::iterator itr = members.begin(); itr !=  members.end(); ++itr)    {        CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, Id, itr->guid);    }}
开发者ID:Kiper,项目名称:mangos,代码行数:10,


示例22: ScanOneLine

static int ScanOneLine(unsigned char *line){	char *q,*p = strchr(line,')');	DataPoint d;	const DataPoint *old=NULL;	size_t typ=0;	int t;	if (p == NULL)		return -1;	q = p+1;	*p-- = 0;	while (*p == ' ' )		p--;	while (isId(p)) {		p--;	}	p++;	while (*q == ' ')  q++;	if (*q == '(')		q++;	else return -1;	if (Data == NULL) {		Data = iDictionary.Create(sizeof(DataPoint),200);	}	old = iDictionary.GetElement(Data,p);	memset(&d,0,sizeof(d));	t = istrCollection.IndexOf(Exceptions,p,&typ);	//printf("%s: t=%d, index %ull/n",p,t,typ);	if (t >= 0) {		char *save = p;		p = line;		while (*p == ' ' || *p == '/t')			p++;		q = GetId(p);		*q = 0;		t = FindType(p);		if (t < 0) {			if (strcmp(p,"ElementType")) {				return -1;			}			typ = 3;		}		else typ = t;		if (old == NULL) d.ApiName = strdup(save);	}	else {		if (old ==NULL) d.ApiName = strdup(p);		p = q;		q = GetId(q);		*q=0;		if (!strcmp(p,"const")) {			q++;			while (*q == ' ' || *q == '/t')				q++;			p = q;			q = GetId(q);			*q=0;		}		t = FindType(p);		if (t < 0) {			if (strcmp(p,"ElementType")) {				free(d.ApiName);				return -1;			}			typ = 12;		}		else typ = t;	}	if (old) {		memcpy(&d,old,sizeof(DataPoint));	}		d.type[typ] = typ+1;	if (Data == NULL) {		Data = iDictionary.Create(sizeof(DataPoint),200);	}	iDictionary.Add(Data,d.ApiName,&d);	return 1;}
开发者ID:jacob-navia,项目名称:ccl,代码行数:83,


示例23: MAKE_NEW_GUID

bool ArenaTeam::LoadMembersFromDB(QueryResult result){    if (!result)        return false;    bool captainPresentInTeam = false;    do    {        Field* fields = result->Fetch();        // Prevent crash if db records are broken when all members in result are already processed and current team doesn't have any members        if (!fields)            break;        uint32 arenaTeamId = fields[0].GetUInt32();        // We loaded all members for this arena_team already, break cycle        if (arenaTeamId > TeamId)            break;        ArenaTeamMember newMember;        newMember.Guid             = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);        newMember.WeekGames        = fields[2].GetUInt16();        newMember.WeekWins         = fields[3].GetUInt16();        newMember.SeasonGames      = fields[4].GetUInt16();        newMember.SeasonWins       = fields[5].GetUInt16();        //newMember.Name             = fields[6].GetString();        newMember.Class            = fields[7].GetUInt8();        newMember.PersonalRating   = fields[8].GetUInt16();        newMember.MatchMakerRating = fields[9].GetUInt16() > 0 ? fields[9].GetUInt16() : sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);;        newMember.MaxMMR           = std::max(fields[10].GetUInt16(), newMember.MatchMakerRating);        // Delete member if character information is missing        if (fields[6].GetString().empty())        {            sLog->outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));            this->DelMember(newMember.Guid, true);            continue;        }        // Check if team team has a valid captain        if (newMember.Guid == GetCaptain())            captainPresentInTeam = true;        // Put the player in the team        Members.push_back(newMember);        sWorld->UpdateGlobalPlayerArenaTeam(GUID_LOPART(newMember.Guid), GetSlot(), GetId());    }    while (result->NextRow());    if (Empty() || !captainPresentInTeam)    {        // Arena team is empty or captain is not in team, delete from db#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)        sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);#endif        return false;    }    return true;}
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:62,


示例24: WXUNUSED

bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)){    wxString value;    int sel = -1;    switch ( param )    {        case CBN_SELENDOK:        case CBN_SELCHANGE:            sel = GetSelection();            // we may sometimes get 2 CBN_SELCHANGE events or a CBN_SELENDOK            // before CBN_SELCHANGE with the same index when the user selects            // an item in the combobox -- ignore duplicates            if ( sel > -1 && sel != m_selectionOld )            {                m_selectionOld = sel;                // GetValue() would still return the old value from here but                // according to the docs we should return the new value if the                // user calls it in his event handler, so update internal                // m_value                m_value = GetString(sel);                wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());                event.SetInt(sel);                event.SetEventObject(this);                event.SetString(m_value);                ProcessCommand(event);            }            else // no valid selection            {                m_selectionOld = sel;                // hence no EVT_TEXT neither                break;            }            // fall through: for compability with wxGTK, also send the text            // update event when the selection changes (this also seems more            // logical as the text does change)        case CBN_EDITCHANGE:            {                wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());                // if sel != -1, value was initialized above (and we can't use                // GetValue() here as it would return the old selection and we                // want the new one)                if ( sel == -1 )                {                    m_value = wxGetWindowText(GetHwnd());                    m_selectionOld = -1;                }                else // we're synthesizing text updated event from sel change                {                    // We need to retrieve the current selection because the                    // user may have changed it in the previous handler (for                    // CBN_SELCHANGE above).                    sel = GetSelection();                    if ( sel > -1 )                    {                        m_value = GetString(sel);                    }                }                event.SetString(m_value);                event.SetEventObject(this);                ProcessCommand(event);            }            break;    }    // there is no return value for the CBN_ notifications, so always return    // false from here to pass the message to DefWindowProc()    return false;}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:76,


示例25: GUID_LOPART

bool ArenaTeam::AddMember(uint64 playerGuid){    std::string playerName;    uint8 playerClass;    // Check if arena team is full (Can't have more than type * 2 players)    if (GetMembersSize() >= GetType() * 2)        return false;    // xinef: Get player name and class from player storage or global data storage    Player* player = ObjectAccessor::FindPlayerInOrOutOfWorld(playerGuid);    if (player)    {        playerClass = player->getClass();        playerName = player->GetName();    }    else    {        GlobalPlayerData const* playerData = sWorld->GetGlobalPlayerData(GUID_LOPART(playerGuid));        if (!playerData)            return false;        playerName = playerData->name;        playerClass = playerData->playerClass;    }    // Check if player is already in a similar arena team    if ((player && player->GetArenaTeamId(GetSlot())) || Player::GetArenaTeamIdFromStorage(GUID_LOPART(playerGuid), GetSlot()) != 0)    {        sLog->outError("Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());        return false;    }    // Set player's personal rating    uint32 personalRating = 0;    if (sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)        personalRating = sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);    else if (GetRating() >= 1000)        personalRating = 1000;    // xinef: zomg! sync query    // Try to get player's match maker rating from db and fall back to config setting if not found    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);    stmt->setUInt32(0, GUID_LOPART(playerGuid));    stmt->setUInt8(1, GetSlot());    PreparedQueryResult result = CharacterDatabase.Query(stmt);    uint16 matchMakerRating;    uint16 maxMMR;    if (result)    {        matchMakerRating = (*result)[0].GetUInt16();        uint16 Max = (*result)[1].GetUInt16();        maxMMR = std::max(Max, matchMakerRating);    }    else    {        matchMakerRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);        maxMMR = matchMakerRating;    }    // Remove all player signatures from other petitions    // This will prevent player from joining too many arena teams and corrupt arena team data integrity    Player::RemovePetitionsAndSigns(playerGuid, GetType());    // Feed data to the struct    ArenaTeamMember newMember;    //newMember.Name             = playerName;    newMember.Guid             = playerGuid;    newMember.Class            = playerClass;    newMember.SeasonGames      = 0;    newMember.WeekGames        = 0;    newMember.SeasonWins       = 0;    newMember.WeekWins         = 0;    newMember.PersonalRating   = personalRating;    newMember.MatchMakerRating = matchMakerRating;    newMember.MaxMMR           = maxMMR;    Members.push_back(newMember);    sWorld->UpdateGlobalPlayerArenaTeam(GUID_LOPART(playerGuid), GetSlot(), GetId());    // Save player's arena team membership to db    stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER);    stmt->setUInt32(0, TeamId);    stmt->setUInt32(1, GUID_LOPART(playerGuid));    CharacterDatabase.Execute(stmt);    // Inform player if online    if (player)    {        player->SetInArenaTeam(TeamId, GetSlot(), GetType());        player->SetArenaTeamIdInvited(0);        // Hide promote/remove buttons        if (CaptainGuid != playerGuid)            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);    }    return true;//.........这里部分代码省略.........
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:101,


示例26: WXUNUSED

void wxRibbonPanel::OnMouseClick(wxMouseEvent& WXUNUSED(evt)){    if(IsMinimised())    {        if(m_expanded_panel != NULL)        {            HideExpanded();        }        else        {            ShowExpanded();        }    }    else if(IsExtButtonHovered())    {        wxRibbonPanelEvent notification(wxEVT_COMMAND_RIBBONPANEL_EXTBUTTON_ACTIVATED, GetId());        notification.SetEventObject(this);        notification.SetPanel(this);        ProcessEvent(notification);    }}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:21,


示例27: GUID_LOPART

bool ArenaTeam::AddMember(uint64 playerGuid){    std::string playerName;    uint8 playerClass;    // Check if arena team is full (Can't have more than type * 2 players)    if (GetMembersSize() >= GetType() * 2)        return false;    // Get player name and class either from db or ObjectMgr    Player* player = ObjectAccessor::FindPlayer(playerGuid);    if (player)    {        playerClass = player->getClass();        playerName = player->GetName();    }    else    {        //          0     1        // SELECT name, class FROM characters WHERE guid = ?        PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_CLASS);        stmt->setUInt32(0, GUID_LOPART(playerGuid));        PreparedQueryResult result = CharacterDatabase.Query(stmt);        if (!result)            return false;        playerName = (*result)[0].GetString();        playerClass = (*result)[1].GetUInt8();    }    // Check if player is already in a similar arena team    if ((player && player->GetArenaTeamId(GetSlot())) || Player::GetArenaTeamIdFromDB(playerGuid, GetType()) != 0)    {        SF_LOG_DEBUG("bg.arena", "Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());        return false;    }    // Set player's personal rating    uint32 personalRating = 0;    if (sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)        personalRating = sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);    else if (GetRating() >= 1000)        personalRating = 1000;    // Try to get player's match maker rating from db and fall back to config setting if not found    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);    stmt->setUInt32(0, GUID_LOPART(playerGuid));    stmt->setUInt8(1, GetSlot());    PreparedQueryResult result = CharacterDatabase.Query(stmt);    uint32 matchMakerRating;    if (result)        matchMakerRating = (*result)[0].GetUInt16();    else        matchMakerRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);    // Remove all player signatures from other petitions    // This will prevent player from joining too many arena teams and corrupt arena team data integrity    Player::RemovePetitionsAndSigns(playerGuid, GetType());    // Feed data to the struct    ArenaTeamMember newMember;    newMember.Name             = playerName;    newMember.Guid             = playerGuid;    newMember.Class            = playerClass;    newMember.SeasonGames      = 0;    newMember.WeekGames        = 0;    newMember.SeasonWins       = 0;    newMember.WeekWins         = 0;    newMember.PersonalRating   = personalRating;    newMember.MatchMakerRating = matchMakerRating;    Members.push_back(newMember);    // Save player's arena team membership to db    stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER);    stmt->setUInt32(0, TeamId);    stmt->setUInt32(1, GUID_LOPART(playerGuid));    CharacterDatabase.Execute(stmt);    // Inform player if online    if (player)    {        player->SetInArenaTeam(TeamId, GetSlot(), GetType());        player->SetArenaTeamIdInvited(0);        // Hide promote/remove buttons        if (CaptainGuid != playerGuid)            player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);    }    SF_LOG_DEBUG("bg.arena", "Player: %s [GUID: %u] joined arena team type: %u [Id: %u, Name: %s].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId(), GetName().c_str());    return true;}
开发者ID:Nightprince,项目名称:SkyFire.548,代码行数:97,


示例28: GUID_LOPART

bool ArenaTeam::Create(uint32 captainGuid, uint8 type, std::string teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor){    // 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:Alluring,项目名称:TrinityCore,代码行数:46,


示例29: wxCHECK_RET

void wxWindowDFB::PaintWindow(const wxRect& rect){    wxCHECK_RET( !IsFrozen() && IsShown(), "shouldn't be called" );    wxLogTrace(TRACE_PAINT,               "%p ('%s'): painting region [%i,%i,%i,%i]",               this, GetName().c_str(),               rect.x, rect.y, rect.GetRight(), rect.GetBottom());    m_updateRegion = rect;    // FIXME_DFB: don't waste time rendering the area if it's fully covered    //            by some children, go directly to rendering the children    //            (unless some child has HasTransparentBackground()=true!)    // NB: unconditionally send wxEraseEvent, because our implementation of    //     wxWindow::Refresh() ignores the eraseBack argument    wxWindowDC dc((wxWindow*)this);    wxEraseEvent eventEr(m_windowId, &dc);    eventEr.SetEventObject(this);    HandleWindowEvent(eventEr);    wxRect clientRect(GetClientRect());    // only send wxNcPaintEvent if drawing at least part of nonclient area:    if ( !clientRect.Contains(rect) )    {        wxNcPaintEvent eventNc(GetId());        eventNc.SetEventObject(this);        HandleWindowEvent(eventNc);    }    else    {        wxLogTrace(TRACE_PAINT, "%p ('%s'): not sending wxNcPaintEvent",                   this, GetName().c_str());    }    // only send wxPaintEvent if drawing at least part of client area:    if ( rect.Intersects(clientRect) )    {        wxPaintEvent eventPt(GetId());        eventPt.SetEventObject(this);        HandleWindowEvent(eventPt);    }    else    {        wxLogTrace(TRACE_PAINT, "%p ('%s'): not sending wxPaintEvent",                   this, GetName().c_str());    }    // draw window's overlays on top of the painted window, if we have any:    PaintOverlays(rect);    m_updateRegion.Clear();    // client area portion of 'rect':    wxRect rectClientOnly(rect);    rectClientOnly.Intersect(clientRect);    // paint the children:    wxPoint origin = GetClientAreaOrigin();    wxWindowList& children = GetChildren();    for ( wxWindowList::iterator i = children.begin();          i != children.end(); ++i )    {        wxWindow *child = *i;        if ( child->IsFrozen() || !child->IsShown() )            continue; // don't paint anything if the window is frozen or hidden        // compute child's area to repaint        wxRect childrect(child->GetRect());        childrect.Offset(origin);        if ( child->CanBeOutsideClientArea() )            childrect.Intersect(rect);        else            childrect.Intersect(rectClientOnly);        if ( childrect.IsEmpty() )            continue;        // and repaint it:        childrect.Offset(-child->GetPosition());        childrect.Offset(-origin);        child->PaintWindow(childrect);    }}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:88,



注:本文中的GetId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetIdent函数代码示例
C++ GetIconInfo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。