RPG 模块(eve.RPG):Actor 工厂 + 定义注册 + 帧调度 + 事件缓存。 更多...
#include <RPG.h>
Public 成员函数 | |
| Module_REG (RPG) | |
| RPG ()=default | |
| Rpg. | |
| ~RPG () override=default | |
| Rpg. | |
| RPGActor * | newActor () |
| 创建一个空白 RPGActor。 | |
| Party * | newParty () |
| Create an empty generation-safe party roster. | |
| int | registerEffectsFromJson (const std::string &json) |
| 效果定义注册(数据驱动,进程级注册表)。 | |
| void | clearEffectDefinitions () |
| Clears effect definitions. | |
| int | getEffectDefinitionCount () |
| Returns the effect definition count. | |
| int | registerSkillsFromJson (const std::string &json) |
| 技能定义注册。 | |
| void | clearSkillDefinitions () |
| Clears skill definitions. | |
| int | getSkillDefinitionCount () |
| Returns the skill definition count. | |
| int | registerQuestsFromJson (const std::string &json) |
| 任务定义注册。 | |
| eve::Result< int > | replaceQuestsFromJson (const std::string &json) |
| Strictly validate and atomically replace the process-local quest catalogue. | |
| void | clearQuestDefinitions () |
| int | getQuestDefinitionCount () |
| Returns the quest definition count. | |
| bool | hasQuestDefinition (const std::string &id) const |
| Return whether one exact quest definition is present in the current catalogue. | |
| eve::Result< int > | claimQuestRewards (Tracker *tracker, GameState *gameState, inventory::Bag *bag, const std::string &questId) |
| Atomically complete one ready quest and apply all item/attribute rewards. | |
| eve::Result< int > | collectWorldLoot (Tracker *tracker, GameState *gameState, inventory::Bag *bag, const WorldLootRequest &request) |
| Atomically settle one persistent loot object across world, quest, state and inventory owners. | |
| eve::Result< BattleVictoryReceipt > | settleBattleVictory (RPGActor *actor, Tracker *tracker, GameState *gameState, const BattleVictoryRequest &request) |
| Atomically settle one victorious persistent encounter. | |
| eve::Result< int > | buyFromShop (GameState *gameState, inventory::Bag *bag, const std::string ¤cyId, const std::string &itemId, int quantity, double unitPrice) |
| Atomically debit GameState currency and add purchased items to Bag. | |
| eve::Result< int > | sellToShop (GameState *gameState, inventory::Bag *bag, const std::string ¤cyId, const std::string &itemId, int quantity, double unitPrice) |
| Atomically remove sold items from Bag and credit GameState currency. | |
| eve::Result< int > | replaceShopOffersFromJson (const std::string &json) |
| Strictly validate and atomically replace the authoritative shop catalogue. | |
| int | getShopOfferCount () const |
| Return the committed shop-offer count. | |
| void | clearShopOffers () |
| Clear the shop catalogue for teardown or failed initial publication rollback. | |
| bool | hasShopOffer (const std::string &offerId) const |
| Return whether an exact shop offer id exists. | |
| std::string | getShopOfferId (int index) const |
| Returns the shop offer id. | |
| std::string | getShopOfferItemId (int index) const |
| Returns the shop offer item id. | |
| std::string | getShopOfferName (int index) const |
| Returns the shop offer name. | |
| std::string | getShopOfferDescription (int index) const |
| Returns the shop offer description. | |
| int | getShopOfferBuyPrice (int index) const |
| Returns the shop offer buy price. | |
| int | getShopOfferSellPrice (int index) const |
| Returns the shop offer sell price. | |
| eve::Result< int > | buyShopOffer (GameState *gameState, inventory::Bag *bag, const std::string ¤cyId, const std::string &offerId, int quantity) |
| Buy using the item and price from the authoritative shop catalogue. | |
| eve::Result< int > | sellShopOffer (GameState *gameState, inventory::Bag *bag, const std::string ¤cyId, const std::string &offerId, int quantity) |
| Sell using the item and price from the authoritative shop catalogue. | |
| eve::Result< int > | replaceEncountersFromJson (const std::string &json) |
| Strictly replace the data-driven encounter catalogue. | |
| void | clearEncounters () |
| bool | hasEncounter (const std::string &encounterId) const |
| True when encounter. | |
| int | getEncounterMemberCount (const std::string &encounterId) const |
| Returns the encounter member count. | |
| RPGActor * | newEncounterActor (const std::string &encounterId) |
| Create the first member through the single-enemy compatibility facade. | |
| RPGActor * | newEncounterMemberActor (const std::string &encounterId, int memberIndex) |
| Create one indexed member from an encounter composition. | |
| std::string | getEncounterDisplayName (const std::string &encounterId) const |
| Returns the encounter display name. | |
| double | getEncounterMaxHp (const std::string &encounterId) const |
| Returns the encounter max hp. | |
| std::string | getEncounterMemberDisplayName (const std::string &encounterId, int memberIndex) const |
| Returns the encounter member display name. | |
| double | getEncounterMemberMaxHp (const std::string &encounterId, int memberIndex) const |
| Returns the encounter member max hp. | |
| eve::Result< int > | replaceBattleTacticsFromJson (const std::string &json) |
| Strictly replace ordered companion/AI battle tactics. | |
| void | clearBattleTactics () |
| eve::Result< std::string > | queueBattleTactic (Battle *battle, RPGActor *actor, const std::string &tacticsId) |
| Select and queue one action from a registered tactics definition. | |
| eve::Result< int > | replaceStoryEventsFromJson (const std::string &json) |
| Strictly validate and atomically replace versioned story-event content. | |
| void | clearStoryEvents () |
| Clear story-event content during teardown or content-package rollback. | |
| int | getStoryEventCount () const |
| Return the number of committed story-event definitions. | |
| bool | hasStoryEvent (const std::string &eventId) const |
| Return whether an exact story-event id exists. | |
| StoryEventSession * | newStoryEventSession () |
| Create an empty caller-owned story-event session. | |
| eve::Result< int > | replaceStoriesFromDnut (const std::string &source, const std::string &path) |
Strictly compile and atomically publish .dnut story content for the RPG dialect. | |
| void | clearStories () |
Clear published .dnut story content during teardown or content rollback. | |
| int | getStoryCount () const |
Return the number of published .dnut stories. | |
| bool | hasStory (const std::string &storyId) const |
Return whether an exact .dnut story id exists. | |
| RpgStorySession * | newStorySession () |
Create an empty caller-owned .dnut story session. | |
| eve::Result< BattleVictoryReceipt > | settleEncounterVictory (RPGActor *actor, Tracker *tracker, GameState *gameState, const std::string &encounterId, const std::string &mapId, const std::string &objectId) |
| Settle a victory using only rewards declared by the encounter catalogue. | |
| Tracker * | newTracker () |
| 创建一个新的目标追踪器(任务日志 / 成就 / 教程各建一份)。 | |
| int | getLevelUpEventCount () const |
| 升级事件缓存(上一次 update() 产生的,供脚本轮询)。 | |
| RPGActor * | getLevelUpEventActor (int index) const |
| Returns the level up event actor. | |
| int | getLevelUpEventPreviousLevel (int index) const |
| Returns the level up event previous level. | |
| int | getLevelUpEventNewLevel (int index) const |
| Returns the level up event new level. | |
| int | getVitalsEventCount () const |
| 生命等资源事件缓存(上一次 update() 产生的,供脚本轮询)。 | |
| RPGActor * | getVitalsEventActor (int index) const |
| Returns the vitals event actor. | |
| std::string | getVitalsEventResource (int index) const |
| Returns the vitals event resource. | |
| std::string | getVitalsEventAction (int index) const |
| Returns the vitals event action. | |
| double | getVitalsEventAmount (int index) const |
| Returns the vitals event amount. | |
| std::string | getVitalsEventSource (int index) const |
| Returns the vitals event source. | |
| double | getVitalsEventCurrent (int index) const |
| Returns the vitals event current. | |
| double | getVitalsEventMax (int index) const |
| Returns the vitals event max. | |
| int | registerItemStatsFromJson (const std::string &itemId, const std::string &json) |
| 装备加成(物品 id → 属性加成)注册与同步。 | |
| void | clearItemStats (const std::string &itemId) |
| Clears item stats. | |
| void | clearAllItemStats () |
| Clears all item stats. | |
| int | getItemStatCount () |
| Returns the item stat count. | |
| int | syncEquipModifiers (RPGActor *actor, inventory::EquipmentSet *equip) |
| 把装备栏当前装备同步为 actor 属性修改器;返回施加条数。 | |
| int | registerLootTablesFromJson (const std::string &json) |
| 掉落表注册与 roll。 | |
| void | clearLootTables () |
| Clears loot tables. | |
| int | getLootTableCount () |
| Returns the loot table count. | |
| int | rollLoot (const std::string &tableId, inventory::Bag *bag, int seed) |
| 用种子随机流 roll 掉落表,把命中物品加入背包;返回掉落物品种类数。 | |
| int | registerTraitsFromJson (const std::string &json) |
| 特征定义注册。 | |
| void | clearTraitDefinitions () |
| Clears trait definitions. | |
| int | getTraitDefinitionCount () |
| Returns the trait definition count. | |
| int | registerClassesFromJson (const std::string &json) |
| 职业定义注册。 | |
| void | clearClassDefinitions () |
| Clears class definitions. | |
| int | getClassDefinitionCount () |
| Returns the class definition count. | |
| int | registerSkillDamage (const std::string &skillId, const std::string &damageType, const std::string &formula, const std::string &element, double critChance, int hitChance) |
| 技能伤害注册(战斗用)与战斗对象。 | |
| void | clearSkillDamage () |
| Clears skill damage. | |
| Battle * | newBattle () |
| 创建一场新的回合制战斗。 | |
| Result< std::unique_ptr< BattleControl > > | newBattleControl (Battle *battle, SubjectRef instance) |
| Create a host-neutral control adapter for a caller-owned battle. | |
| Result< std::unique_ptr< ProductControl > > | newProductControl (SubjectRef instance, GameState *gameState, Tracker *tracker, inventory::Bag *bag) |
| Create a unified shop, quest-reward and world-loot control adapter. | |
| GameState * | newGameState () |
| 创建一份新的游戏状态(开关/变量)。 | |
| WorldState * | newWorldState (GameState *gameState) |
| Create a typed per-map object-state adapter over one GameState owner. | |
| GameState * | globalGameState () |
| 进程级全局游戏状态(借用,不销毁)。 | |
| void | update (float dt) |
| 推进 StatusSystem / SkillSystem,并刷新本帧的 tick / change / cast 事件缓存。 | |
| int | getTickEventCount () const |
| 周期状态 tick 事件(上一次 update() 产生的,供脚本轮询)。 | |
| RPGActor * | getTickEventActor (int index) const |
| Returns the actor referenced by a retained tick event, or null for an invalid index. | |
| int | getTickEventInstanceId (int index) const |
| Returns the tick event instance id. | |
| std::string | getTickEventEffectId (int index) const |
| Returns the tick event effect id. | |
| std::string | getTickEventSource (int index) const |
| Returns the tick event source. | |
| int | getTickEventStacks (int index) const |
| Returns the tick event stacks. | |
| int | getStatusChangeEventCount () const |
| 状态生命周期变更事件(apply/refresh/extend/stack/remove/expire/reject)。 | |
| RPGActor * | getStatusChangeEventActor (int index) const |
| Returns the actor referenced by a status event, or null for an invalid index. | |
| int | getStatusChangeEventInstanceId (int index) const |
| Returns the status change event instance id. | |
| std::string | getStatusChangeEventEffectId (int index) const |
| Returns the status change event effect id. | |
| std::string | getStatusChangeEventSource (int index) const |
| Returns the status change event source. | |
| std::string | getStatusChangeEventAction (int index) const |
| Returns the status change event action. | |
| int | getStatusChangeEventStacks (int index) const |
| Returns the status change event stacks. | |
| std::string | getStatusChangeEventReason (int index) const |
| Returns the status change event reason. | |
| int | getCastEventCount () const |
| 技能释放结算事件。 | |
| RPGActor * | getCastEventCaster (int index) const |
| Returns the caster referenced by a cast event, or null for an invalid index. | |
| RPGActor * | getCastEventTarget (int index) const |
| Returns the target referenced by a cast event, or null for an invalid index. | |
| std::string | getCastEventSkillId (int index) const |
| Returns the cast event skill id. | |
| SettlementContext * | newSettlementContext () |
| 结算:新建上下文 / 运行流水线 / 配置阶段。 | |
| void | runSettlement (const std::string &pipeline, SettlementContext *ctx) |
| Run settlement. | |
| int | getSettlementStageCount (const std::string &pipeline) |
| Returns the settlement stage count. | |
| bool | hasSettlementStage (const std::string &pipeline, const std::string &stage) |
| True when settlement stage. | |
| bool | setSettlementStageEnabled (const std::string &pipeline, const std::string &stage, bool enabled) |
| Sets the settlement stage enabled. | |
| bool | setSettlementStagePriority (const std::string &pipeline, const std::string &stage, int priority) |
| Sets the settlement stage priority. | |
| bool | removeSettlementStage (const std::string &pipeline, const std::string &stage) |
| Removes settlement stage. | |
| void | clearSettlementPipeline (const std::string &pipeline) |
| Clears settlement pipeline. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
构造及析构函数说明
◆ RPG()
|
default |
Rpg.
◆ ~RPG()
|
overridedefault |
Rpg.
成员函数说明
◆ buyFromShop()
| eve::Result< int > eve::rpg::RPG::buyFromShop | ( | GameState * | gameState, |
| inventory::Bag * | bag, | ||
| const std::string & | currencyId, | ||
| const std::string & | itemId, | ||
| int | quantity, | ||
| double | unitPrice | ||
| ) |
Atomically debit GameState currency and add purchased items to Bag.
引用了 eve::rpg::ShopTransaction::buy(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 itemId.
◆ buyShopOffer()
| eve::Result< int > eve::rpg::RPG::buyShopOffer | ( | GameState * | gameState, |
| inventory::Bag * | bag, | ||
| const std::string & | currencyId, | ||
| const std::string & | offerId, | ||
| int | quantity | ||
| ) |
Buy using the item and price from the authoritative shop catalogue.
引用了 eve::rpg::ShopTransaction::buyOffer(), eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::InvalidArgument.
◆ claimQuestRewards()
| eve::Result< int > eve::rpg::RPG::claimQuestRewards | ( | Tracker * | tracker, |
| GameState * | gameState, | ||
| inventory::Bag * | bag, | ||
| const std::string & | questId | ||
| ) |
Atomically complete one ready quest and apply all item/attribute rewards.
- 返回
- Committed reward-entry count, or a structured failure without observable mutation. @thread Call on the authoritative state owners' simulation thread. @reentrancy Inventory observers run only after the complete state is committed.
引用了 eve::rpg::QuestReward::claim(), eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::InvalidArgument.
◆ clearAllItemStats()
| void eve::rpg::RPG::clearAllItemStats | ( | ) |
◆ clearBattleTactics()
| void eve::rpg::RPG::clearBattleTactics | ( | ) |
◆ clearClassDefinitions()
| void eve::rpg::RPG::clearClassDefinitions | ( | ) |
◆ clearEffectDefinitions()
| void eve::rpg::RPG::clearEffectDefinitions | ( | ) |
◆ clearEncounters()
| void eve::rpg::RPG::clearEncounters | ( | ) |
◆ clearItemStats()
| void eve::rpg::RPG::clearItemStats | ( | const std::string & | itemId | ) |
Clears item stats.
引用了 eve::rpg::EquipmentSystem::clearItemStats() , 以及 itemId.
◆ clearLootTables()
| void eve::rpg::RPG::clearLootTables | ( | ) |
◆ clearQuestDefinitions()
| void eve::rpg::RPG::clearQuestDefinitions | ( | ) |
◆ clearSettlementPipeline()
| void eve::rpg::RPG::clearSettlementPipeline | ( | const std::string & | pipeline | ) |
Clears settlement pipeline.
◆ clearShopOffers()
| void eve::rpg::RPG::clearShopOffers | ( | ) |
Clear the shop catalogue for teardown or failed initial publication rollback.
◆ clearSkillDamage()
| void eve::rpg::RPG::clearSkillDamage | ( | ) |
◆ clearSkillDefinitions()
| void eve::rpg::RPG::clearSkillDefinitions | ( | ) |
◆ clearStories()
| void eve::rpg::RPG::clearStories | ( | ) |
Clear published .dnut story content during teardown or content rollback.
◆ clearStoryEvents()
| void eve::rpg::RPG::clearStoryEvents | ( | ) |
Clear story-event content during teardown or content-package rollback.
◆ clearTraitDefinitions()
| void eve::rpg::RPG::clearTraitDefinitions | ( | ) |
◆ collectWorldLoot()
| eve::Result< int > eve::rpg::RPG::collectWorldLoot | ( | Tracker * | tracker, |
| GameState * | gameState, | ||
| inventory::Bag * | bag, | ||
| const WorldLootRequest & | request | ||
| ) |
Atomically settle one persistent loot object across world, quest, state and inventory owners.
- 返回
- Committed-effect count, or a structured failure without observable mutation. @thread Call on the authoritative owners' simulation thread. @reentrancy Inventory observers run only after all owners are committed.
引用了 eve::rpg::WorldInteraction::collectLoot(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 request.
◆ getCastEventCaster()
| RPGActor * eve::rpg::RPG::getCastEventCaster | ( | int | index | ) | const |
Returns the caster referenced by a cast event, or null for an invalid index.
- 返回
- Borrowed nullable ECS actor pointer from the event projection. @ownership The ECS world owns the actor; the event cache never transfers ownership. @lifetime Valid until actor/world destruction; use a persistent identity or handle after polling. @thread Call on the RPG simulation thread before the next event-producing update. @reentrancy Do not retain across callbacks or event-cache refresh.
引用了 index.
◆ getCastEventCount()
◆ getCastEventSkillId()
| std::string eve::rpg::RPG::getCastEventSkillId | ( | int | index | ) | const |
◆ getCastEventTarget()
| RPGActor * eve::rpg::RPG::getCastEventTarget | ( | int | index | ) | const |
Returns the target referenced by a cast event, or null for an invalid index.
- 返回
- Borrowed nullable ECS actor pointer from the event projection. @ownership The ECS world owns the actor; the event cache never transfers ownership. @lifetime Valid until actor/world destruction; use a persistent identity or handle after polling. @thread Call on the RPG simulation thread before the next event-producing update. @reentrancy Do not retain across callbacks or event-cache refresh.
引用了 index.
◆ getClassDefinitionCount()
| int eve::rpg::RPG::getClassDefinitionCount | ( | ) |
◆ getEffectDefinitionCount()
| int eve::rpg::RPG::getEffectDefinitionCount | ( | ) |
◆ getEncounterDisplayName()
| std::string eve::rpg::RPG::getEncounterDisplayName | ( | const std::string & | encounterId | ) | const |
Returns the encounter display name.
◆ getEncounterMaxHp()
| double eve::rpg::RPG::getEncounterMaxHp | ( | const std::string & | encounterId | ) | const |
◆ getEncounterMemberCount()
| int eve::rpg::RPG::getEncounterMemberCount | ( | const std::string & | encounterId | ) | const |
Returns the encounter member count.
◆ getEncounterMemberDisplayName()
| std::string eve::rpg::RPG::getEncounterMemberDisplayName | ( | const std::string & | encounterId, |
| int | memberIndex | ||
| ) | const |
Returns the encounter member display name.
◆ getEncounterMemberMaxHp()
| double eve::rpg::RPG::getEncounterMemberMaxHp | ( | const std::string & | encounterId, |
| int | memberIndex | ||
| ) | const |
Returns the encounter member max hp.
◆ getItemStatCount()
| int eve::rpg::RPG::getItemStatCount | ( | ) |
◆ getLevelUpEventActor()
| RPGActor * eve::rpg::RPG::getLevelUpEventActor | ( | int | index | ) | const |
◆ getLevelUpEventCount()
| int eve::rpg::RPG::getLevelUpEventCount | ( | ) | const |
◆ getLevelUpEventNewLevel()
| int eve::rpg::RPG::getLevelUpEventNewLevel | ( | int | index | ) | const |
◆ getLevelUpEventPreviousLevel()
| int eve::rpg::RPG::getLevelUpEventPreviousLevel | ( | int | index | ) | const |
◆ getLootTableCount()
| int eve::rpg::RPG::getLootTableCount | ( | ) |
◆ getQuestDefinitionCount()
| int eve::rpg::RPG::getQuestDefinitionCount | ( | ) |
◆ getSettlementStageCount()
| int eve::rpg::RPG::getSettlementStageCount | ( | const std::string & | pipeline | ) |
Returns the settlement stage count.
◆ getShopOfferBuyPrice()
| int eve::rpg::RPG::getShopOfferBuyPrice | ( | int | index | ) | const |
Returns the shop offer buy price.
引用了 eve::rpg::ShopCatalogue::at() , 以及 index.
◆ getShopOfferCount()
| int eve::rpg::RPG::getShopOfferCount | ( | ) | const |
◆ getShopOfferDescription()
| std::string eve::rpg::RPG::getShopOfferDescription | ( | int | index | ) | const |
Returns the shop offer description.
引用了 eve::rpg::ShopCatalogue::at() , 以及 index.
◆ getShopOfferId()
| std::string eve::rpg::RPG::getShopOfferId | ( | int | index | ) | const |
◆ getShopOfferItemId()
| std::string eve::rpg::RPG::getShopOfferItemId | ( | int | index | ) | const |
Returns the shop offer item id.
引用了 eve::rpg::ShopCatalogue::at() , 以及 index.
◆ getShopOfferName()
| std::string eve::rpg::RPG::getShopOfferName | ( | int | index | ) | const |
◆ getShopOfferSellPrice()
| int eve::rpg::RPG::getShopOfferSellPrice | ( | int | index | ) | const |
Returns the shop offer sell price.
引用了 eve::rpg::ShopCatalogue::at() , 以及 index.
◆ getSkillDefinitionCount()
| int eve::rpg::RPG::getSkillDefinitionCount | ( | ) |
◆ getStatusChangeEventAction()
| std::string eve::rpg::RPG::getStatusChangeEventAction | ( | int | index | ) | const |
◆ getStatusChangeEventActor()
| RPGActor * eve::rpg::RPG::getStatusChangeEventActor | ( | int | index | ) | const |
Returns the actor referenced by a status event, or null for an invalid index.
- 返回
- Borrowed nullable ECS actor pointer from the event projection. @ownership The ECS world owns the actor; the event cache never transfers ownership. @lifetime Valid until actor/world destruction; use a persistent identity or handle after polling. @thread Call on the RPG simulation thread before the next event-producing update. @reentrancy Do not retain across callbacks or event-cache refresh.
引用了 index.
◆ getStatusChangeEventCount()
| int eve::rpg::RPG::getStatusChangeEventCount | ( | ) | const |
◆ getStatusChangeEventEffectId()
| std::string eve::rpg::RPG::getStatusChangeEventEffectId | ( | int | index | ) | const |
◆ getStatusChangeEventInstanceId()
| int eve::rpg::RPG::getStatusChangeEventInstanceId | ( | int | index | ) | const |
◆ getStatusChangeEventReason()
| std::string eve::rpg::RPG::getStatusChangeEventReason | ( | int | index | ) | const |
◆ getStatusChangeEventSource()
| std::string eve::rpg::RPG::getStatusChangeEventSource | ( | int | index | ) | const |
◆ getStatusChangeEventStacks()
| int eve::rpg::RPG::getStatusChangeEventStacks | ( | int | index | ) | const |
◆ getStoryCount()
| int eve::rpg::RPG::getStoryCount | ( | ) | const |
Return the number of published .dnut stories.
◆ getStoryEventCount()
| int eve::rpg::RPG::getStoryEventCount | ( | ) | const |
Return the number of committed story-event definitions.
◆ getTickEventActor()
| RPGActor * eve::rpg::RPG::getTickEventActor | ( | int | index | ) | const |
Returns the actor referenced by a retained tick event, or null for an invalid index.
- 返回
- Borrowed nullable ECS actor pointer from the event projection. @ownership The ECS world owns the actor; the event cache never transfers ownership. @lifetime Valid until actor/world destruction; use the actor's persistent identity or handle after the poll. @thread Call on the RPG simulation thread before the next event-producing update. @reentrancy Do not retain across callbacks or event-cache refresh.
引用了 index.
◆ getTickEventCount()
| int eve::rpg::RPG::getTickEventCount | ( | ) | const |
◆ getTickEventEffectId()
| std::string eve::rpg::RPG::getTickEventEffectId | ( | int | index | ) | const |
◆ getTickEventInstanceId()
| int eve::rpg::RPG::getTickEventInstanceId | ( | int | index | ) | const |
◆ getTickEventSource()
| std::string eve::rpg::RPG::getTickEventSource | ( | int | index | ) | const |
◆ getTickEventStacks()
| int eve::rpg::RPG::getTickEventStacks | ( | int | index | ) | const |
◆ getTraitDefinitionCount()
| int eve::rpg::RPG::getTraitDefinitionCount | ( | ) |
◆ getVitalsEventAction()
| std::string eve::rpg::RPG::getVitalsEventAction | ( | int | index | ) | const |
◆ getVitalsEventActor()
| RPGActor * eve::rpg::RPG::getVitalsEventActor | ( | int | index | ) | const |
◆ getVitalsEventAmount()
| double eve::rpg::RPG::getVitalsEventAmount | ( | int | index | ) | const |
◆ getVitalsEventCount()
| int eve::rpg::RPG::getVitalsEventCount | ( | ) | const |
◆ getVitalsEventCurrent()
| double eve::rpg::RPG::getVitalsEventCurrent | ( | int | index | ) | const |
◆ getVitalsEventMax()
| double eve::rpg::RPG::getVitalsEventMax | ( | int | index | ) | const |
◆ getVitalsEventResource()
| std::string eve::rpg::RPG::getVitalsEventResource | ( | int | index | ) | const |
◆ getVitalsEventSource()
| std::string eve::rpg::RPG::getVitalsEventSource | ( | int | index | ) | const |
◆ globalGameState()
| GameState * eve::rpg::RPG::globalGameState | ( | ) |
进程级全局游戏状态(借用,不销毁)。
- 返回
- Borrowed nullable global GameState owned by the process.
◆ hasEncounter()
| bool eve::rpg::RPG::hasEncounter | ( | const std::string & | encounterId | ) | const |
◆ hasQuestDefinition()
| bool eve::rpg::RPG::hasQuestDefinition | ( | const std::string & | id | ) | const |
Return whether one exact quest definition is present in the current catalogue.
◆ hasSettlementStage()
| bool eve::rpg::RPG::hasSettlementStage | ( | const std::string & | pipeline, |
| const std::string & | stage | ||
| ) |
◆ hasShopOffer()
| bool eve::rpg::RPG::hasShopOffer | ( | const std::string & | offerId | ) | const |
Return whether an exact shop offer id exists.
◆ hasStory()
| bool eve::rpg::RPG::hasStory | ( | const std::string & | storyId | ) | const |
Return whether an exact .dnut story id exists.
◆ hasStoryEvent()
| bool eve::rpg::RPG::hasStoryEvent | ( | const std::string & | eventId | ) | const |
Return whether an exact story-event id exists.
◆ Module_REG()
| eve::rpg::RPG::Module_REG | ( | RPG | ) |
◆ newActor()
| RPGActor * eve::rpg::RPG::newActor | ( | ) |
创建一个空白 RPGActor。
- 返回
- Borrowed nullable pointer to an ECS-owned actor; null means creation failed. @ownership The ECS world owns the actor; callers must release it through ECS and never delete it. @lifetime Valid until actor/world destruction; retain the generation-qualified EntityHandle across frames. @thread Call on the RPG module's owning ECS thread. @reentrancy The factory invokes no user callbacks; do not re-enter structural ECS mutation while using the result.
◆ newBattle()
| Battle * eve::rpg::RPG::newBattle | ( | ) |
◆ newBattleControl()
| Result< std::unique_ptr< BattleControl > > eve::rpg::RPG::newBattleControl | ( | Battle * | battle, |
| SubjectRef | instance | ||
| ) |
Create a host-neutral control adapter for a caller-owned battle.
- 参数
-
battle Borrowed battle that must outlive the returned adapter. instance Stable identity used by player, test and AI clients.
- 返回
- Owning adapter or structured validation failure. @ownership The returned unique pointer owns the adapter and must be reset before battle destruction. @thread Create and use on the RPG simulation thread.
引用了 eve::Diagnostic::error(), eve::InvalidArgument , 以及 eve::SubjectRef::isValid().
◆ newEncounterActor()
| RPGActor * eve::rpg::RPG::newEncounterActor | ( | const std::string & | encounterId | ) |
Create the first member through the single-enemy compatibility facade.
- 返回
- Borrowed nullable actor owned by the RPG ECS world. @ownership The RPG ECS world owns the actor; callers release it through RPGActor::release(). @lifetime Valid until release, RPG teardown, or owning ECS world reset. @thread Call on the owning simulation thread. @reentrancy Does not invoke callbacks.
◆ newEncounterMemberActor()
| RPGActor * eve::rpg::RPG::newEncounterMemberActor | ( | const std::string & | encounterId, |
| int | memberIndex | ||
| ) |
Create one indexed member from an encounter composition.
- 返回
- Borrowed nullable actor owned by the RPG ECS world. @ownership The RPG ECS world owns the actor; callers release it through RPGActor::release(). @lifetime Valid until release, RPG teardown, or owning ECS world reset. @thread Call on the owning simulation thread. @reentrancy Does not invoke callbacks.
◆ newGameState()
| GameState * eve::rpg::RPG::newGameState | ( | ) |
◆ newParty()
| Party * eve::rpg::RPG::newParty | ( | ) |
Create an empty generation-safe party roster.
◆ newProductControl()
| Result< std::unique_ptr< ProductControl > > eve::rpg::RPG::newProductControl | ( | SubjectRef | instance, |
| GameState * | gameState, | ||
| Tracker * | tracker, | ||
| inventory::Bag * | bag | ||
| ) |
Create a unified shop, quest-reward and world-loot control adapter.
- 返回
- Owning adapter or structured validation failure. @ownership Reset the returned unique pointer before GameState, Tracker or Bag destruction. @thread Create and use on all participants' common simulation thread.
引用了 eve::Diagnostic::error(), eve::InvalidArgument , 以及 eve::SubjectRef::isValid().
◆ newSettlementContext()
| SettlementContext * eve::rpg::RPG::newSettlementContext | ( | ) |
结算:新建上下文 / 运行流水线 / 配置阶段。
- 返回
- Owned nullable heap context; the caller must destroy it after the synchronous pipeline call. @ownership The caller owns the returned context and is responsible for its explicit destruction. @lifetime Valid until the caller destroys it; it is not retained by RPG or the settlement registry. @thread Create and use on the owning simulation thread. @reentrancy Construction invokes no external callbacks; do not pass the context to re-entrant mutation.
◆ newStoryEventSession()
| StoryEventSession * eve::rpg::RPG::newStoryEventSession | ( | ) |
◆ newStorySession()
| RpgStorySession * eve::rpg::RPG::newStorySession | ( | ) |
Create an empty caller-owned .dnut story session.
- 返回
- Owned nullable session; caller destroys it after use. @ownership The caller owns the session, which borrows domain objects only for a call. @thread Create and use on the RPG simulation thread. @reentrancy Construction invokes no callbacks.
◆ newTracker()
| Tracker * eve::rpg::RPG::newTracker | ( | ) |
创建一个新的目标追踪器(任务日志 / 成就 / 教程各建一份)。
- 返回
- Owned nullable tracker created with new; the caller must destroy it. @ownership The caller owns the returned tracker and is responsible for its destruction. @lifetime Valid until the caller destroys it; not retained by RPG. @thread Create and use on the owning simulation thread. @reentrancy Construction calls syncAuto which emits activation events; poll before reading.
◆ newWorldState()
| WorldState * eve::rpg::RPG::newWorldState | ( | GameState * | gameState | ) |
Create a typed per-map object-state adapter over one GameState owner.
- 参数
-
gameState Borrowed authoritative state that must outlive the returned adapter.
◆ queueBattleTactic()
| eve::Result< std::string > eve::rpg::RPG::queueBattleTactic | ( | Battle * | battle, |
| RPGActor * | actor, | ||
| const std::string & | tacticsId | ||
| ) |
Select and queue one action from a registered tactics definition.
◆ registerClassesFromJson()
| int eve::rpg::RPG::registerClassesFromJson | ( | const std::string & | json | ) |
◆ registerEffectsFromJson()
| int eve::rpg::RPG::registerEffectsFromJson | ( | const std::string & | json | ) |
◆ registerItemStatsFromJson()
| int eve::rpg::RPG::registerItemStatsFromJson | ( | const std::string & | itemId, |
| const std::string & | json | ||
| ) |
装备加成(物品 id → 属性加成)注册与同步。
引用了 itemId , 以及 eve::rpg::EquipmentSystem::registerItemStatsFromJson().
◆ registerLootTablesFromJson()
| int eve::rpg::RPG::registerLootTablesFromJson | ( | const std::string & | json | ) |
◆ registerQuestsFromJson()
| int eve::rpg::RPG::registerQuestsFromJson | ( | const std::string & | json | ) |
◆ registerSkillDamage()
| int eve::rpg::RPG::registerSkillDamage | ( | const std::string & | skillId, |
| const std::string & | damageType, | ||
| const std::string & | formula, | ||
| const std::string & | element, | ||
| double | critChance, | ||
| int | hitChance | ||
| ) |
◆ registerSkillsFromJson()
| int eve::rpg::RPG::registerSkillsFromJson | ( | const std::string & | json | ) |
◆ registerTraitsFromJson()
| int eve::rpg::RPG::registerTraitsFromJson | ( | const std::string & | json | ) |
◆ removeSettlementStage()
| bool eve::rpg::RPG::removeSettlementStage | ( | const std::string & | pipeline, |
| const std::string & | stage | ||
| ) |
Removes settlement stage.
◆ replaceBattleTacticsFromJson()
| eve::Result< int > eve::rpg::RPG::replaceBattleTacticsFromJson | ( | const std::string & | json | ) |
Strictly replace ordered companion/AI battle tactics.
引用了 eve::rpg::BattleTacticsCatalogue::replaceFromJsonStrict().
◆ replaceEncountersFromJson()
| eve::Result< int > eve::rpg::RPG::replaceEncountersFromJson | ( | const std::string & | json | ) |
Strictly replace the data-driven encounter catalogue.
◆ replaceQuestsFromJson()
| eve::Result< int > eve::rpg::RPG::replaceQuestsFromJson | ( | const std::string & | json | ) |
Strictly validate and atomically replace the process-local quest catalogue.
- 返回
- Committed definition count or a structured failure; the previous catalogue survives failure. @thread Call on the owning simulation/content thread. @reentrancy Does not invoke script callbacks.
◆ replaceShopOffersFromJson()
| eve::Result< int > eve::rpg::RPG::replaceShopOffersFromJson | ( | const std::string & | json | ) |
Strictly validate and atomically replace the authoritative shop catalogue.
◆ replaceStoriesFromDnut()
| eve::Result< int > eve::rpg::RPG::replaceStoriesFromDnut | ( | const std::string & | source, |
| const std::string & | path | ||
| ) |
◆ replaceStoryEventsFromJson()
| eve::Result< int > eve::rpg::RPG::replaceStoryEventsFromJson | ( | const std::string & | json | ) |
Strictly validate and atomically replace versioned story-event content.
◆ rollLoot()
| int eve::rpg::RPG::rollLoot | ( | const std::string & | tableId, |
| inventory::Bag * | bag, | ||
| int | seed | ||
| ) |
用种子随机流 roll 掉落表,把命中物品加入背包;返回掉落物品种类数。
引用了 eve::rpg::LootSystem::roll() , 以及 seed.
◆ runSettlement()
| void eve::rpg::RPG::runSettlement | ( | const std::string & | pipeline, |
| SettlementContext * | ctx | ||
| ) |
◆ sellShopOffer()
| eve::Result< int > eve::rpg::RPG::sellShopOffer | ( | GameState * | gameState, |
| inventory::Bag * | bag, | ||
| const std::string & | currencyId, | ||
| const std::string & | offerId, | ||
| int | quantity | ||
| ) |
Sell using the item and price from the authoritative shop catalogue.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::rpg::ShopTransaction::sellOffer().
◆ sellToShop()
| eve::Result< int > eve::rpg::RPG::sellToShop | ( | GameState * | gameState, |
| inventory::Bag * | bag, | ||
| const std::string & | currencyId, | ||
| const std::string & | itemId, | ||
| int | quantity, | ||
| double | unitPrice | ||
| ) |
Atomically remove sold items from Bag and credit GameState currency.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, itemId , 以及 eve::rpg::ShopTransaction::sell().
◆ setSettlementStageEnabled()
| bool eve::rpg::RPG::setSettlementStageEnabled | ( | const std::string & | pipeline, |
| const std::string & | stage, | ||
| bool | enabled | ||
| ) |
Sets the settlement stage enabled.
引用了 enabled , 以及 eve::rpg::SettlementPipeline::setStageEnabled().
◆ setSettlementStagePriority()
| bool eve::rpg::RPG::setSettlementStagePriority | ( | const std::string & | pipeline, |
| const std::string & | stage, | ||
| int | priority | ||
| ) |
Sets the settlement stage priority.
引用了 priority , 以及 eve::rpg::SettlementPipeline::setStagePriority().
◆ settleBattleVictory()
| eve::Result< BattleVictoryReceipt > eve::rpg::RPG::settleBattleVictory | ( | RPGActor * | actor, |
| Tracker * | tracker, | ||
| GameState * | gameState, | ||
| const BattleVictoryRequest & | request | ||
| ) |
Atomically settle one victorious persistent encounter.
- 返回
- Levels and learned skills after the complete settlement, or structured failure. @thread Call on the authoritative owners' simulation thread. @reentrancy No callbacks are invoked; level events are poll-only.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, request , 以及 eve::rpg::BattleVictory::settle().
◆ settleEncounterVictory()
| eve::Result< BattleVictoryReceipt > eve::rpg::RPG::settleEncounterVictory | ( | RPGActor * | actor, |
| Tracker * | tracker, | ||
| GameState * | gameState, | ||
| const std::string & | encounterId, | ||
| const std::string & | mapId, | ||
| const std::string & | objectId | ||
| ) |
Settle a victory using only rewards declared by the encounter catalogue.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::rpg::EncounterCatalogue::find(), eve::InvalidArgument, eve::rpg::BattleVictoryRequest::mapId, eve::NotFound, request , 以及 eve::rpg::BattleVictory::settle().
◆ syncEquipModifiers()
| int eve::rpg::RPG::syncEquipModifiers | ( | RPGActor * | actor, |
| inventory::EquipmentSet * | equip | ||
| ) |
把装备栏当前装备同步为 actor 属性修改器;返回施加条数。
◆ update()
| void eve::rpg::RPG::update | ( | float | dt | ) |
推进 StatusSystem / SkillSystem,并刷新本帧的 tick / change / cast 事件缓存。
引用了 eve::rpg::SkillSystem::pollCastEvents(), eve::rpg::StatusSystem::pollChanges(), eve::rpg::VitalsSystem::pollEvents(), eve::rpg::LevelSystem::pollLevelUps(), eve::rpg::StatusSystem::pollTicks(), eve::rpg::StatusSystem::update() , 以及 eve::rpg::SkillSystem::update().
该类的文档由以下文件生成:
Public 成员函数 继承自