pub trait Affinity {
    // Required method
    fn weak_against(&self, other: &Self) -> bool;

    // Provided methods
    fn strong_against(&self, other: &Self) -> bool { ... }
    fn multiplier(&self, other: &Self) -> f32 { ... }
    fn calculate(&self, amount: f64, other: &Self) -> f64 { ... }
}

Required Methods§

source

fn weak_against(&self, other: &Self) -> bool

Check if the affinity is weak to another

Provided Methods§

source

fn strong_against(&self, other: &Self) -> bool

Check if the affinity is strong to another

source

fn multiplier(&self, other: &Self) -> f32

Default implementation for a multiplier

source

fn calculate(&self, amount: f64, other: &Self) -> f64

Calculate the amount based on the affinity

Object Safety§

This trait is not object safe.

Implementors§