本文整理汇总了C++中EvilNumber::GetPyObject方法的典型用法代码示例。如果您正苦于以下问题:C++ EvilNumber::GetPyObject方法的具体用法?C++ EvilNumber::GetPyObject怎么用?C++ EvilNumber::GetPyObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvilNumber
的用法示例。
在下文中一共展示了EvilNumber::GetPyObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Change
bool AttributeMap::Change( uint32 attributeID, EvilNumber& old_val, EvilNumber& new_val )
{
Notify_OnModuleAttributeChange modChange;
modChange.ownerID = mItem.ownerID();
modChange.itemKey = mItem.itemID();
modChange.attributeID = attributeID;
modChange.time = Win32TimeNow();
modChange.newValue = new_val.GetPyObject();
modChange.oldValue = old_val.GetPyObject();
return SendAttributeChanges(modChange.Encode());
}
示例2: Change
bool AttributeMap::Change( uint32 attributeID, EvilNumber& old_val, EvilNumber& new_val )
{
mChanged = true;
PyTuple* AttrChange = new PyTuple(7);
AttrChange->SetItem(0, new PyString("OnModuleAttributeChange"));
AttrChange->SetItem(1, new PyInt(mItem.ownerID()));
AttrChange->SetItem(2, new PyInt(mItem.itemID()));
AttrChange->SetItem(3, new PyInt(attributeID));
AttrChange->SetItem(4, new PyLong(Win32TimeNow()));
AttrChange->SetItem(5, old_val.GetPyObject());
AttrChange->SetItem(6, new_val.GetPyObject());
return SendAttributeChanges(AttrChange);
}
示例3: ValidateAddItem
/*
* InventoryEx
*/
void InventoryEx::ValidateAddItem(EVEItemFlags flag, InventoryItemRef item) const
{
//double volume = item->quantity() * item->volume();
EvilNumber volume = item->GetAttribute(AttrQuantity) * item->GetAttribute(AttrVolume);
double capacity = GetRemainingCapacity( flag );
if( volume > capacity )
{
std::map<std::string, PyRep *> args;
args["available"] = new PyFloat( capacity );
args["volume"] = volume.GetPyObject();
throw PyException( MakeUserError( "NotEnoughCargoSpace", args ) );
}
}