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

Process-local validated offer catalogue used by RPG shop transactions and UI. 更多...

#include <ShopCatalogue.h>

静态 Public 成员函数

static eve::Result< int > replaceFromJsonStrict (const std::string &json)
 Strictly validate and atomically replace the entire offer catalogue.
 
static void clear ()
 Remove all offers. Intended for teardown and isolated tests.
 
static int count ()
 Return the number of committed offers in deterministic source order.
 
static const ShopOffer * find (const std::string &id)
 Find an offer by stable offer id, or null when absent.
 
static const ShopOffer * at (int index)
 Return an offer by deterministic source index, or null when out of range.
 

详细描述

Process-local validated offer catalogue used by RPG shop transactions and UI.

在文件 ShopCatalogue.h 第 24 行定义.

成员函数说明

◆ at()

const ShopOffer * eve::rpg::ShopCatalogue::at ( int  index)
static

Return an offer by deterministic source index, or null when out of range.

在文件 ShopCatalogue.cpp 第 114 行定义.

引用了 count() , 以及 index.

被这些函数引用 eve::rpg::RPG::getShopOfferBuyPrice(), eve::rpg::RPG::getShopOfferDescription(), eve::rpg::RPG::getShopOfferId(), eve::rpg::RPG::getShopOfferItemId(), eve::rpg::RPG::getShopOfferName() , 以及 eve::rpg::RPG::getShopOfferSellPrice().

◆ clear()

void eve::rpg::ShopCatalogue::clear ( )
static

Remove all offers. Intended for teardown and isolated tests.

在文件 ShopCatalogue.cpp 第 102 行定义.

被这些函数引用 eve::rpg::RPG::clearShopOffers().

◆ count()

int eve::rpg::ShopCatalogue::count ( )
static

Return the number of committed offers in deterministic source order.

在文件 ShopCatalogue.cpp 第 107 行定义.

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

◆ find()

const ShopOffer * eve::rpg::ShopCatalogue::find ( const std::string &  id)
static

Find an offer by stable offer id, or null when absent.

在文件 ShopCatalogue.cpp 第 109 行定义.

引用了 found.

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

◆ replaceFromJsonStrict()

eve::Result< int > eve::rpg::ShopCatalogue::replaceFromJsonStrict ( const std::string &  json)
static

Strictly validate and atomically replace the entire offer catalogue.

返回
Committed offer count, or a structured failure that preserves the previous catalogue.
备注
Every item must already exist in inventory::ItemRegistry. Unknown fields are rejected. @thread Call on the owning content/simulation thread. @reentrancy No callbacks are invoked.

在文件 ShopCatalogue.cpp 第 48 行定义.

引用了 eve::rpg::ShopOffer::buyPrice, description, eve::rpg::ShopOffer::description, eve::rpg::ShopOffer::displayName, eve::inventory::ItemRegistry::find(), eve::rpg::ShopOffer::id, index, itemId, eve::rpg::ShopOffer::itemId, name, eve::json::Document::parse(), path, root, eve::rpg::ShopOffer::sellPrice, size , 以及 eve::Result< T >::success().

被这些函数引用 eve::rpg::RPG::replaceShopOffersFromJson().


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