[][src]Trait weasel::fight::FightRules

pub trait FightRules<R: BattleRules> {
    type Impact: Clone + Debug + Serialize + for<'a> Deserialize<'a>;
    fn apply_impact(
        &self,
        _state: &BattleState<R>,
        _impact: &Self::Impact,
        _event_queue: &mut Option<EventQueue<R>>,
        _entropy: &mut Entropy<R>,
        _metrics: &mut WriteMetrics<R>
    ) { ... } }

Rules to determine how combat works. They manage the damage dealt, accuracy of attacks and, more in general, how to apply consequences of abilities.

Associated Types

type Impact: Clone + Debug + Serialize + for<'a> Deserialize<'a>

See Impact.

Loading content...

Provided methods

fn apply_impact(
    &self,
    _state: &BattleState<R>,
    _impact: &Self::Impact,
    _event_queue: &mut Option<EventQueue<R>>,
    _entropy: &mut Entropy<R>,
    _metrics: &mut WriteMetrics<R>
)

Takes an impact and generates one or more events to change the state of creatures or other objects.

The provided implementation does nothing.

Loading content...

Implementors

impl<R: BattleRules> FightRules<R> for EmptyFightRules[src]

type Impact = ()

Loading content...