void PagePipeGraph::InitData(OutMgr &mgr, OutAttrArray &Array) { InitAttr(Array); PipeTranOut *pOut = NULL; ComponentStmOut *pStmOut = NULL; StationOut *pStation = NULL; int nCount = mgr.GetCount(); int n=0; int i=0; CString strText; while (n<nCount) {//排序 pStmOut = mgr.LookUp(i++); if(pStmOut != NULL) { strText.Format(_T("%d(管道)"),i-1); HTREEITEM hitem = InsertItem(strText,i-1); pOut = dynamic_cast<PipeTranOut*>(pStmOut); ASSERT(pOut != NULL); pStation = pOut->GetStationOut(); ASSERT(pStation != NULL); IteratorPtr<StationStmOut> iteratorPtr(pStation->CreatIterator()); for(iteratorPtr->Fist();!iteratorPtr->IsDone();iteratorPtr->Next()) { pStmOut = &iteratorPtr->CurrentItem(); // strText.Format(_T("位置(%d)"),pStmOut->Key()) // InsertItem(strText,pStmOut->Key(),hitem); strText.Format(_T("位置(%d)"),pStmOut->GetnValue(29)); InsertItem(strText,pStmOut->GetnValue(29),hitem);//在StationStmOut类中Key()只是管子的Key。在这里取位置作为关键字。 } n++; } } }
BOOL HumanSkillUpgrade::HumanSkillLevelUp( const Obj_Human* pHuman, SkillID_t iSkillID, INT iLevel ) { __ENTER_FUNCTION; InitAttr(pHuman, iSkillID, iLevel); if( !CheckCondition() ) { SendFailedSkillLevelupMsg(); return FALSE; } DepleteHumanAttr(); UpgradeLevel(); SendSuccessSkillLevelupMsg(); StartPassiveSkill(iSkillID, pHuman); return TRUE; __LEAVE_FUNCTION }