Skip to main content

Module stack

Module stack 

Source
Expand description

Showdown-style effect-stack battle engine (Pattern C) — vertical-slice POC (design doc 06-battle-engine-effect-stack-design.md, §8).

This is an additive sibling to crate::battle::driver; the existing BattleDriver and every other game’s code keep compiling unchanged. The module is 100% game-agnostic: no game-specific concrete types, no rand (randomness only via the existing BattleRng).

§Pieces

Re-exports§

pub use ctx::BattleCtx;
pub use ctx::EffectHost;
pub use ctx::EffectProvider;
pub use ctx::EffectState;
pub use ctx::MoveContext;
pub use dispatch::collect_handlers;
pub use dispatch::compare;
pub use dispatch::run_event;
pub use dispatch::run_event_checked;
pub use dispatch::CollectedHandler;
pub use driver::FirstMover;
pub use driver::StackDriver;
pub use driver::StackTurnResult;
pub use log::HpChangeCause;
pub use log::TurnEvent;
pub use log::TurnLog;
pub use event::Effect;
pub use event::EffectId;
pub use event::EffectType;
pub use event::Event;
pub use event::EventHook;
pub use event::HandlerFn;
pub use event::HandlerResult;
pub use event::RelayVar;

Modules§

authoring
Developer-facing effect-authoring helpers (design §4.1).
ctx
The effect provider, per-effect state arena, per-move scratch, and the split-borrow BattleCtx (design §3).
dispatch
Handler collection, the Showdown comparePriority comparator, the speed-tie draw, and the run_event dispatch fold (design §1.3, §3.4).
driver
The StackDriver — the fixed per-turn firing sequence (design §2).
event
Event taxonomy, handler signature, and effect registration types for the Showdown-style effect-stack battle engine (design doc §1).
log
P6a — a generic, additive per-turn event log for stack-driven battles.