pub trait EvolutionProvider: MonsterProvider {
type EvoItem: Copy + Eq + Debug;
// Required method
fn evolution_target(
&self,
inst: &MonsterInstance<Self>,
trigger: EvolutionTrigger<Self::EvoItem>,
) -> Option<Self::SpeciesId>
where Self: Sized;
}Expand description
Evolution hooks. Layered on top of MonsterProvider.
The trigger carries an opaque, game-defined item id (Self::EvoItem) so
the engine never couples to a concrete item system.
Required Associated Types§
Required Methods§
Sourcefn evolution_target(
&self,
inst: &MonsterInstance<Self>,
trigger: EvolutionTrigger<Self::EvoItem>,
) -> Option<Self::SpeciesId>where
Self: Sized,
fn evolution_target(
&self,
inst: &MonsterInstance<Self>,
trigger: EvolutionTrigger<Self::EvoItem>,
) -> Option<Self::SpeciesId>where
Self: Sized,
Decide what species (if any) this instance evolves into right now, given a trigger. The game encodes all conditions; the engine just applies the result.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".