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

掉落系统:进程级掉落表 + 随机 roll 入包。 @thread roll 使用调用方提供的 rng(命名随机流),可在任意线程执行。 更多...

#include <LootSystem.h>

静态 Public 成员函数

static void registerTable (const LootTableDefinition &def)
 Registers table.
 
static int registerTablesFromJson (const std::string &json)
 Registers tables from json.
 
static const LootTableDefinition * find (const std::string &id)
 Finds .
 
static void clear ()
 Clears .
 
static int count ()
 Returns the number of .
 
static int roll (const std::string &tableId, eve::inventory::Bag *bag, std::mt19937 &rng)
 按掉落表 roll 一次,把命中的物品加入 bag。
 

详细描述

掉落系统:进程级掉落表 + 随机 roll 入包。 @thread roll 使用调用方提供的 rng(命名随机流),可在任意线程执行。

在文件 LootSystem.h 第 43 行定义.

成员函数说明

◆ clear()

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

Clears .

在文件 LootSystem.cpp 第 66 行定义.

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

◆ count()

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

Returns the number of .

在文件 LootSystem.cpp 第 68 行定义.

引用了 size.

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

◆ find()

const LootTableDefinition * eve::rpg::LootSystem::find ( const std::string &  id)
static

Finds .

在文件 LootSystem.cpp 第 60 行定义.

引用了 t.

被这些函数引用 roll().

◆ registerTable()

void eve::rpg::LootSystem::registerTable ( const LootTableDefinition &  def)
static

Registers table.

在文件 LootSystem.cpp 第 19 行定义.

引用了 eve::rpg::LootTableDefinition::id.

◆ registerTablesFromJson()

◆ roll()

int eve::rpg::LootSystem::roll ( const std::string &  tableId,
eve::inventory::Bag *  bag,
std::mt19937 &  rng 
)
static

按掉落表 roll 一次,把命中的物品加入 bag。

返回
本次命中并掉落的物品种类数(0 表示全未命中或表不存在)。

在文件 LootSystem.cpp 第 70 行定义.

引用了 eve::inventory::Bag::addItem(), eve::rpg::LootTableDefinition::entries , 以及 find().

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


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