TnuaScheme

Trait TnuaScheme 

Source
pub trait TnuaScheme:
    'static
    + Send
    + Sync
    + Sized {
    type Basis: TnuaBasis;
    type Config: TnuaSchemeConfig<Scheme = Self> + Asset;
    type ActionDiscriminant: TnuaActionDiscriminant;
    type ActionState: TnuaActionState<Basis = Self::Basis, Discriminant = Self::ActionDiscriminant>;

    // Required method
    fn discriminant(&self) -> Self::ActionDiscriminant;
}
Expand description

Required Associated Types§

Source

type Basis: TnuaBasis

The base motion controller of the character. Typically TnuaBuiltinWalk

Source

type Config: TnuaSchemeConfig<Scheme = Self> + Asset

A big configuration struct, containing the configuration of the basis and of all the actions.

Source

type ActionDiscriminant: TnuaActionDiscriminant

An enum with a unit variant for each variant of the control scheme.

Source

type ActionState: TnuaActionState<Basis = Self::Basis, Discriminant = Self::ActionDiscriminant>

An enum mirroring the control scheme, except instead of just having the input of each action each variant has a TnuaActionState which contains the action’s input, configuration and memoery. If the variant in the control scheme has payload, they are copied to the variant in action state as is.

Required Methods§

Source

fn discriminant(&self) -> Self::ActionDiscriminant

The action without the input and payloads.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§