parthia_lib/unit.rs
1//! Represents a unit in Fire Emblem with the associated stats such units have.
2//! Because different Fire Emblem games have different stats and they mean
3//! different things, this is a trait that has to be implemented specifically
4//! for different games.
5
6use crate::weapon::{Weapon, Item};
7
8/// A unit in Fire Emblem that can attack and defend.
9pub trait Unit: Sized {
10 /// Attacks the target with the given weapon, updating both this unit and
11 /// the target.
12 fn attack(&mut self, enemy: &mut Self,
13 atk_weapon: dyn Weapon<Self>, def_weapon: dyn Weapon<Self>,
14 atk_item: dyn Item<Self>, def_item: dyn Item<Self>);
15}