载入中...
搜索中...
未找到
eve::rpg::ShopTransaction类 参考

Product transaction boundary for an RPG shop trade. 更多...

#include <ShopTransaction.h>

静态 Public 成员函数

static eve::Result< int > buyOffer (GameState &gameState, inventory::Bag &bag, const std::string &currencyId, const std::string &offerId, int quantity)
 Buy a quantity using the authoritative price and item in ShopCatalogue.
 
static eve::Result< int > sellOffer (GameState &gameState, inventory::Bag &bag, const std::string &currencyId, const std::string &offerId, int quantity)
 Sell a quantity using the authoritative price and item in ShopCatalogue.
 
static eve::Result< int > buy (GameState &gameState, inventory::Bag &bag, const std::string &currencyId, const std::string &itemId, int quantity, double unitPrice)
 Atomically debit currency and add the purchased item quantity.
 
static eve::Result< int > sell (GameState &gameState, inventory::Bag &bag, const std::string &currencyId, const std::string &itemId, int quantity, double unitPrice)
 Atomically remove an item quantity and credit its sale proceeds.
 

详细描述

Product transaction boundary for an RPG shop trade.

在文件 ShopTransaction.h 第 23 行定义.

成员函数说明

◆ buy()

eve::Result< int > eve::rpg::ShopTransaction::buy ( GameState &  gameState,
inventory::Bag &  bag,
const std::string &  currencyId,
const std::string &  itemId,
int  quantity,
double  unitPrice 
)
static

Atomically debit currency and add the purchased item quantity.

返回
Committed item quantity, or structured failure with neither owner mutated. @ownership GameState and Bag remain caller-owned and must outlive this call. @thread Call on both participants' owning simulation thread. @reentrancy Inventory observers run only after currency and Bag reach their final state.

在文件 ShopTransaction.cpp 第 75 行定义.

引用了 eve::rpg::GameState::addVariable(), eve::inventory::InventorySystem::commitAddBatch(), eve::Result< T >::failure(), itemId, eve::inventory::InventorySystem::prepareAddBatch() , 以及 eve::rpg::GameState::snapshotJson().

被这些函数引用 eve::rpg::RPG::buyFromShop() , 以及 buyOffer().

◆ buyOffer()

eve::Result< int > eve::rpg::ShopTransaction::buyOffer ( GameState &  gameState,
inventory::Bag &  bag,
const std::string &  currencyId,
const std::string &  offerId,
int  quantity 
)
static

Buy a quantity using the authoritative price and item in ShopCatalogue.

在文件 ShopTransaction.cpp 第 53 行定义.

引用了 buy(), eve::rpg::ShopOffer::buyPrice, eve::rpg::ShopCatalogue::find(), eve::rpg::ShopOffer::itemId , 以及 eve::NotFound.

被这些函数引用 eve::rpg::RPG::buyShopOffer() , 以及 eve::rpg::ProductControl::submitGameplay().

◆ sell()

eve::Result< int > eve::rpg::ShopTransaction::sell ( GameState &  gameState,
inventory::Bag &  bag,
const std::string &  currencyId,
const std::string &  itemId,
int  quantity,
double  unitPrice 
)
static

Atomically remove an item quantity and credit its sale proceeds.

返回
Committed item quantity, or structured failure with neither owner mutated. @ownership GameState and Bag remain caller-owned and must outlive this call. @thread Call on both participants' owning simulation thread. @reentrancy Inventory observers run only after currency and Bag reach their final state.

在文件 ShopTransaction.cpp 第 93 行定义.

引用了 eve::rpg::GameState::addVariable(), eve::inventory::InventorySystem::commitRemove(), eve::Result< T >::failure(), itemId, eve::inventory::InventorySystem::prepareRemove() , 以及 eve::rpg::GameState::snapshotJson().

被这些函数引用 sellOffer() , 以及 eve::rpg::RPG::sellToShop().

◆ sellOffer()

eve::Result< int > eve::rpg::ShopTransaction::sellOffer ( GameState &  gameState,
inventory::Bag &  bag,
const std::string &  currencyId,
const std::string &  offerId,
int  quantity 
)
static

Sell a quantity using the authoritative price and item in ShopCatalogue.

在文件 ShopTransaction.cpp 第 64 行定义.

引用了 eve::rpg::ShopCatalogue::find(), eve::rpg::ShopOffer::itemId, eve::NotFound, sell() , 以及 eve::rpg::ShopOffer::sellPrice.

被这些函数引用 eve::rpg::RPG::sellShopOffer() , 以及 eve::rpg::ProductControl::submitGameplay().


该类的文档由以下文件生成: