Skip to main content

Unit

Trait Unit 

Source
pub trait Unit: Send + Sync {
Show 21 methods // Required methods fn id(&self) -> UnitId; fn kind(&self) -> UnitKind; fn building(&self) -> BuildingId; fn score(&self) -> Score; fn stats(&self) -> &UnitStats; fn power(&self) -> Power; fn attack(&self) -> AttackPower; fn defense(&self) -> DefensePower; fn ranged_debuff(&self) -> RangedDebuff; fn speed(&self, config: &WorldConfig) -> Speed; fn haul(&self) -> Haul; fn chunk(&self) -> &UnitChunk; fn infrastructure_requirements(&self) -> &InfrastructureRequirements; // Provided methods fn is_cavalry(&self) -> bool { ... } fn is_infantry(&self) -> bool { ... } fn is_ranged(&self) -> bool { ... } fn is_offensive(&self) -> bool { ... } fn is_defensive(&self) -> bool { ... } fn is_academy_unit(&self) -> bool { ... } fn is_stable_unit(&self) -> bool { ... } fn is_workshop_unit(&self) -> bool { ... }
}

Required Methods§

Source

fn id(&self) -> UnitId

Source

fn kind(&self) -> UnitKind

Source

fn building(&self) -> BuildingId

Building where the unit is recruited.

Source

fn score(&self) -> Score

Source

fn stats(&self) -> &UnitStats

Source

fn power(&self) -> Power

Source

fn attack(&self) -> AttackPower

Source

fn defense(&self) -> DefensePower

Source

fn ranged_debuff(&self) -> RangedDebuff

Source

fn speed(&self, config: &WorldConfig) -> Speed

Source

fn haul(&self) -> Haul

Source

fn chunk(&self) -> &UnitChunk

Source

fn infrastructure_requirements(&self) -> &InfrastructureRequirements

Building levels required to recruit the unit.

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§