Skip to main content

EvolutionProvider

Trait EvolutionProvider 

Source
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§

Source

type EvoItem: Copy + Eq + Debug

Opaque item identifier used by item-based evolutions.

Required Methods§

Source

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".

Implementors§