Skip to main content

wowlab_engine_content/hooks/beast_mastery_hunter/
handler.rs

1use wowlab_engine_combat::CombatHandler;
2use wowlab_engine_ports::{HandlerParams, SimContext};
3
4
5use super::config::register_beast_cleave;
6
7#[derive(Debug)]
8pub(crate) struct BeastMasteryHandler {
9    inner: CombatHandler,
10}
11
12impl BeastMasteryHandler {
13    /// Finishes the specialization handler from the shared-content composition stage.
14    pub(crate) fn try_new(
15        parts: crate::composition::ContentHandlerParts,
16        params: &HandlerParams<'_>,
17    ) -> Result<Self, wowlab_engine_ports::EngineError> {
18        let mut built = parts.into_built();
19
20        register_beast_cleave(&mut built, params)?;
21
22        Ok(Self {
23            inner: CombatHandler::from_built(built),
24        })
25    }
26}
27
28crate::hooks::define_spec_handler! {
29impl BeastMasteryHandler(self, inner) {
30    fn on_sim_start(&mut self, ctx: &mut SimContext) {
31        self.inner.on_sim_start(ctx);
32    }
33}
34}