Skip to content

Finalize reward execution and lookup cleanup - #290

Merged
BenCodez merged 7 commits into
masterfrom
refactor/reward-execution-final
Aug 23, 2026
Merged

BenCodez merged 7 commits into
masterfrom
refactor/reward-execution-final

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Finish the current reward-subsystem cleanup in one PR by extracting reward execution, normalizing direct/sub-direct lookup behavior, and reducing RewardHandler to a compatibility facade plus lifecycle/UI glue.

Execution

  • add api.rewards.RewardExecutor
    • all giveReward(...) dispatch forms
    • list/string/config-section dispatch
    • direct and sub-direct execution
    • command-style reward strings
    • choice reward dispatch
    • main-thread to async handoff
    • inline reward construction/update helper
  • add api.rewards.RewardExecutionContext
    • wraps RewardOptions internally
    • centralizes online-state initialization
    • centralizes prefix/suffix reward-name construction
    • keeps RewardOptions as the public compatibility object

Lookup/path consistency

  • centralize reward/direct path normalization in RewardRegistry
  • direct reward lookup is now case-insensitive consistently
  • dotted, underscored, and space-normalized direct identifiers resolve through the same canonical path
  • sub-direct lookup keeps dotted/underscored compatibility through the same canonical path
  • reject duplicate direct and sub-direct registrations that normalize to the same identifier
  • make rewardExist(...) follow normal reward-name space/case normalization

RewardHandler cleanup

  • keep existing public RewardHandler methods as facade methods
  • delegate execution/construction to RewardExecutor
  • retain scheduler, startup/shutdown, and edit-GUI glue for compatibility
  • expose getRewardExecutor() alongside the other extracted reward services

Tests

  • expand RewardRegistryTest for case/separator/space normalization and normalized duplicate rejection
  • add RewardExecutorTest covering execution context naming, null options, list/string dispatch, direct/sub-direct dispatch, inline sections, command rewards, async handoff, choice rewards, and update construction

All new classes remain under com.bencodez.advancedcore.api.rewards.

This PR includes intentional lookup consistency fixes in addition to the structural refactor; reward configuration keys and existing RewardHandler public entry points remain unchanged.

@BenCodez
BenCodez marked this pull request as ready for review August 23, 2026 19:46
@BenCodez
BenCodez merged commit b7ab571 into master Aug 23, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/reward-execution-final branch August 23, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant