示例#1
0
 Trade( VERYLONG timestamp, std::string symbol, VERYLONG quantity, unsigned int price )
 {
    SetPrice( price );
    SetQuantity( quantity );
    SetSymbol( symbol );
    SetTimestamp( timestamp );
 }
示例#2
0
bool InventoryItem::AlterQuantity(int32 qty_change, bool notify) {
    if(qty_change == 0)
        return true;

    int32 new_qty = m_quantity + qty_change;

    if(new_qty < 0) {
        codelog(ITEM__ERROR, "%s (%u): Tried to remove %d quantity from stack of %u", m_itemName.c_str(), m_itemID, -qty_change, m_quantity);
        return false;
    }

    return(SetQuantity(new_qty, notify));
}