[−][src]Struct rust_warrior::unit::Unit
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
impl Unit[src]
pub fn new(unit_type: UnitType, position: (i32, i32)) -> Unit[src]
Create a unit of type unit_type at position.
pub fn archer(position: (i32, i32)) -> Unit[src]
Create a unit of type Archer (7 HP, 3 ATK) at position.
pub fn captive(position: (i32, i32)) -> Unit[src]
Create a unit of type Captive (1 HP, 0 ATK) at position.
pub fn sludge(position: (i32, i32)) -> Unit[src]
Create a unit of type Sludge (12 HP, 3 ATK) at position.
pub fn thick_sludge(position: (i32, i32)) -> Unit[src]
Create a unit of type ThickSludge (18 HP, 3 ATK) at position.
pub fn warrior(position: (i32, i32)) -> Unit[src]
Create a unit of type Warrior (20 HP, 5 ATK) at position.
pub fn wizard(position: (i32, i32)) -> Unit[src]
Create a unit of type Wizard (3 HP, 11 ATK) at position.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,