Struct rust_warrior::unit::Unit [−][src]
pub struct Unit {
pub unit_type: UnitType,
pub position: (i32, i32),
pub hp: (i32, i32),
pub atk: i32,
pub facing: Option<Direction>,
}Expand description
The state of a unit: its position, current/max hp, and atk power.
Fields
unit_type: UnitTypeposition: (i32, i32)hp: (i32, i32)atk: i32facing: Option<Direction>Implementations
Create a unit of type unit_type at position.
Create a unit of type Archer (7 HP, 3 ATK) at position.
Create a unit of type Captive (1 HP, 0 ATK) at position.
Create a unit of type Sludge (12 HP, 3 ATK) at position.
Create a unit of type ThickSludge (18 HP, 3 ATK) at position.
Create a unit of type Warrior (20 HP, 5 ATK) at position.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Unit
impl UnwindSafe for Unit
Blanket Implementations
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
Mutably borrows from an owned value. Read more