本文整理汇总了C++中PyList::AddItemLong方法的典型用法代码示例。如果您正苦于以下问题:C++ PyList::AddItemLong方法的具体用法?C++ PyList::AddItemLong怎么用?C++ PyList::AddItemLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyList
的用法示例。
在下文中一共展示了PyList::AddItemLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
void ItemAttributeMgr::Clear(Attr attr) {
PyRep *oldValue = NULL;
if(GetNotify() == true && !IsRechargable(attr)) {
// get old value
oldValue = PyGet(attr);
}
// clear the attribute
EVEAdvancedAttributeMgr::Clear(attr);
// delete the attribute from DB (no matter if it really is there)
if(GetSave() == true) {
m_factory.db().EraseAttribute(m_item.itemID(), attr);
}
if(GetNotify() == true) {
std::map<Attr, TauCap>::const_iterator i = m_tauCap.find(attr);
if(i != m_tauCap.end()) {
// build the special list for rechargables
PyList *l = new PyList;
l->AddItem( PyGet( attr ) );
l->AddItemLong( Win32TimeNow() );
l->AddItem( _PyGet( GetReal( i->second.tau ) / 5.0 ) );
l->AddItem( PyGet( i->second.cap ) );
oldValue = l;
}
// send change
_SendAttributeChange(attr, oldValue, new PyFloat(GetReal(attr)));
}
}
示例2: SetIntEx
void ItemAttributeMgr::SetIntEx(Attr attr, const int_t &v, bool persist) {
PyRep *oldValue = NULL;
if(GetNotify() == true && !IsRechargable(attr)) {
// get old value
oldValue = PyGet(attr);
}
// set the attribute value
EVEAdvancedAttributeMgr::SetInt(attr, v);
// check if we shall save to DB
if(GetSave() == true && (persist || IsPersistent(attr))) {
// save to DB
m_factory.db().UpdateAttribute_int(m_item.itemID(), attr, v);
}
if(GetNotify() == true) {
std::map<Attr, TauCap>::const_iterator i = m_tauCap.find(attr);
if(i != m_tauCap.end()) {
// build the special list for rechargables
PyList *l = new PyList;
l->AddItemInt( v );
l->AddItemLong( Win32TimeNow() );
l->AddItem( _PyGet( GetReal( i->second.tau ) / 5.0 ) );
l->AddItem( PyGet( i->second.cap ) );
oldValue = l;
}
// send change
_SendAttributeChange(attr, oldValue, new PyFloat(v));
}
}