pub trait SpecHandler: Send {
Show 41 methods
// Required methods
fn on_player_ready(
&mut self,
ctx: &mut SimContext<'_>,
) -> Option<SpecAction>;
fn on_cast_complete(&mut self, event: Event, ctx: &mut SimContext<'_>);
fn on_sim_start(&mut self, ctx: &mut SimContext<'_>);
fn total_damage(&self) -> f64;
fn cast_time_ms(&self, spell_id: SpellIdx, empower_rank: u8) -> u32;
// Provided methods
fn on_triggered_spell(
&mut self,
_spell_id: SpellIdx,
_source: ActorId,
_target: ActorId,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_spell_impact(&mut self, _impact_id: u32, _ctx: &mut SimContext<'_>) { ... }
fn on_spell_launch(&mut self, _impact_id: u32, _ctx: &mut SimContext<'_>) { ... }
fn on_guardian_action(
&mut self,
_guardian_id: u32,
_guardian_generation: u32,
_ability_index: usize,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_guardian_expire(
&mut self,
_guardian_id: u32,
_guardian_generation: u32,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_pet_action(
&mut self,
_auto_attack_index: usize,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_aura_tick(&mut self, _event: AuraEventRef, _ctx: &mut SimContext<'_>) { ... }
fn on_channel_tick(
&mut self,
_spell_id: SpellIdx,
_source: ActorId,
_target: EnemyIdx,
_generation: u64,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_aura_expire(
&mut self,
_event: AuraEventRef,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_proc_heartbeat(&mut self, _ctx: &mut SimContext<'_>) { ... }
fn on_death(
&mut self,
_target: EnemyIdx,
_scope: DeathEventScope,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_encounter_despawn(
&mut self,
_scope: PullScope,
_target: EnemyIdx,
_kind: EncounterDespawnKind,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_group_complete(
&mut self,
_scope: PullScope,
_group: GroupId,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_pull_complete(
&mut self,
_scope: PullScope,
_finalize: bool,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_encounter_terminate(
&mut self,
_reason: EncounterTerminationReason,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_wave_activate(
&mut self,
_scope: PullScope,
_wave: WaveId,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_enemy_activate(
&mut self,
_scope: PullScope,
_target: EnemyIdx,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_retarget(&mut self, _scope: PullScope, _ctx: &mut SimContext<'_>) { ... }
fn on_encounter_move(
&mut self,
_scope: PullScope,
_actor: PositionedActorRef,
_transform: SpatialTransform,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_actor_movement(
&mut self,
_actor: ActorId,
_moving: bool,
_generation: u64,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_raid_event(&mut self, _index: usize, _ctx: &mut SimContext<'_>) { ... }
fn on_raid_add_despawn(
&mut self,
_target: EnemyIdx,
_activation_generation: u64,
_encounter_generation: PullLifecycleGeneration,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_external_buff(&mut self, _index: usize, _ctx: &mut SimContext<'_>) { ... }
fn on_event_queue_empty(&mut self, _ctx: &mut SimContext<'_>) { ... }
fn encounter_termination_time(&self) -> Option<SimTime> { ... }
fn on_despawn(
&mut self,
_target: EnemyIdx,
_ctx: &mut SimContext<'_>,
) -> EnemyDespawnOutcome { ... }
fn on_hook_timer(
&mut self,
_timer_id: u32,
_source: ActorId,
_target: Option<EnemyIdx>,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_auto_attack(
&mut self,
_source: ActorId,
_target: EnemyIdx,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_enemy_auto_attack(
&mut self,
_source: EnemyIdx,
_target: ActorId,
_ctx: &mut SimContext<'_>,
) { ... }
fn on_cooldown_ready(
&mut self,
_cooldown_key: SpellIdx,
_ctx: &mut SimContext<'_>,
) { ... }
fn reset(&mut self) { ... }
fn flush_scheduled(&mut self, _push: &mut dyn FnMut(Event)) { ... }
fn take_runtime_error(&mut self) -> Option<SpecRuntimeError> { ... }
fn paperdoll(&self) -> Option<Paperdoll> { ... }
fn introspect(&self) -> SpecIntrospection { ... }
fn attach_decision_trace(&mut self, _sink: Arc<dyn DecisionTraceSink>) { ... }
}Expand description
Executor contract: all spec interaction goes through this trait.
Required Methods§
fn on_player_ready(&mut self, ctx: &mut SimContext<'_>) -> Option<SpecAction>
fn on_cast_complete(&mut self, event: Event, ctx: &mut SimContext<'_>)
fn on_sim_start(&mut self, ctx: &mut SimContext<'_>)
fn total_damage(&self) -> f64
Sourcefn cast_time_ms(&self, spell_id: SpellIdx, empower_rank: u8) -> u32
fn cast_time_ms(&self, spell_id: SpellIdx, empower_rank: u8) -> u32
Cast time in milliseconds; 0 for instants.
Provided Methods§
fn on_triggered_spell( &mut self, _spell_id: SpellIdx, _source: ActorId, _target: ActorId, _ctx: &mut SimContext<'_>, )
fn on_spell_impact(&mut self, _impact_id: u32, _ctx: &mut SimContext<'_>)
fn on_spell_launch(&mut self, _impact_id: u32, _ctx: &mut SimContext<'_>)
fn on_guardian_action( &mut self, _guardian_id: u32, _guardian_generation: u32, _ability_index: usize, _ctx: &mut SimContext<'_>, )
fn on_guardian_expire( &mut self, _guardian_id: u32, _guardian_generation: u32, _ctx: &mut SimContext<'_>, )
fn on_pet_action( &mut self, _auto_attack_index: usize, _ctx: &mut SimContext<'_>, )
fn on_aura_tick(&mut self, _event: AuraEventRef, _ctx: &mut SimContext<'_>)
fn on_channel_tick( &mut self, _spell_id: SpellIdx, _source: ActorId, _target: EnemyIdx, _generation: u64, _ctx: &mut SimContext<'_>, )
fn on_aura_expire(&mut self, _event: AuraEventRef, _ctx: &mut SimContext<'_>)
fn on_proc_heartbeat(&mut self, _ctx: &mut SimContext<'_>)
fn on_death( &mut self, _target: EnemyIdx, _scope: DeathEventScope, _ctx: &mut SimContext<'_>, )
fn on_encounter_despawn( &mut self, _scope: PullScope, _target: EnemyIdx, _kind: EncounterDespawnKind, _ctx: &mut SimContext<'_>, )
fn on_group_complete( &mut self, _scope: PullScope, _group: GroupId, _ctx: &mut SimContext<'_>, )
fn on_pull_complete( &mut self, _scope: PullScope, _finalize: bool, _ctx: &mut SimContext<'_>, )
fn on_encounter_terminate( &mut self, _reason: EncounterTerminationReason, _ctx: &mut SimContext<'_>, )
fn on_wave_activate( &mut self, _scope: PullScope, _wave: WaveId, _ctx: &mut SimContext<'_>, )
fn on_enemy_activate( &mut self, _scope: PullScope, _target: EnemyIdx, _ctx: &mut SimContext<'_>, )
fn on_retarget(&mut self, _scope: PullScope, _ctx: &mut SimContext<'_>)
fn on_encounter_move( &mut self, _scope: PullScope, _actor: PositionedActorRef, _transform: SpatialTransform, _ctx: &mut SimContext<'_>, )
fn on_actor_movement( &mut self, _actor: ActorId, _moving: bool, _generation: u64, _ctx: &mut SimContext<'_>, )
fn on_raid_event(&mut self, _index: usize, _ctx: &mut SimContext<'_>)
fn on_raid_add_despawn( &mut self, _target: EnemyIdx, _activation_generation: u64, _encounter_generation: PullLifecycleGeneration, _ctx: &mut SimContext<'_>, )
fn on_external_buff(&mut self, _index: usize, _ctx: &mut SimContext<'_>)
Sourcefn on_event_queue_empty(&mut self, _ctx: &mut SimContext<'_>)
fn on_event_queue_empty(&mut self, _ctx: &mut SimContext<'_>)
Called only when the shared event queue is empty.
Sourcefn encounter_termination_time(&self) -> Option<SimTime>
fn encounter_termination_time(&self) -> Option<SimTime>
Exact termination timestamp once the encounter policy is satisfied.
Sourcefn on_despawn(
&mut self,
_target: EnemyIdx,
_ctx: &mut SimContext<'_>,
) -> EnemyDespawnOutcome
fn on_despawn( &mut self, _target: EnemyIdx, _ctx: &mut SimContext<'_>, ) -> EnemyDespawnOutcome
Despawn an enemy through the canonical combat cleanup boundary.
Sourcefn on_hook_timer(
&mut self,
_timer_id: u32,
_source: ActorId,
_target: Option<EnemyIdx>,
_ctx: &mut SimContext<'_>,
)
fn on_hook_timer( &mut self, _timer_id: u32, _source: ActorId, _target: Option<EnemyIdx>, _ctx: &mut SimContext<'_>, )
A HookTimer scheduled via the combat layer’s schedule_hook came due.
fn on_auto_attack( &mut self, _source: ActorId, _target: EnemyIdx, _ctx: &mut SimContext<'_>, )
fn on_enemy_auto_attack( &mut self, _source: EnemyIdx, _target: ActorId, _ctx: &mut SimContext<'_>, )
fn on_cooldown_ready( &mut self, _cooldown_key: SpellIdx, _ctx: &mut SimContext<'_>, )
fn flush_scheduled(&mut self, _push: &mut dyn FnMut(Event))
Sourcefn take_runtime_error(&mut self) -> Option<SpecRuntimeError>
fn take_runtime_error(&mut self) -> Option<SpecRuntimeError>
Take a fatal event-processing failure, if the handler recorded one.