Skip to main content

Fight

Enum Fight 

Source
pub enum Fight<'a> {
    Wave(&'a Wave),
    Actor(&'a Actor),
}
Expand description

One fight the campaign declares: a wave or an actor. The one type every rule over “a fight” reads — the health_bar (spec-0073) and the on_kill (spec-0074) alike.

Variants§

§

Wave(&'a Wave)

A waves[] entry — its bodies wear dw_wave_<id>.

§

Actor(&'a Actor)

An actors[] entry — its body wears dw_actor_<id>.

Implementations§

Source§

impl<'a> Fight<'a>

Source

pub fn kind(&self) -> FightKind

Which class this fight is.

Source

pub fn word(&self) -> &'static str

The kebab word a reader of a diagnostic knows the class by.

Source

pub fn tier(&self) -> Option<EncounterTier>

The billing the fight declares.

Source

pub fn health_bar(&self) -> Option<&'a HealthBar>

The fight’s health_bar, if it declares one (spec-0073).

Source

pub fn own_name(&self) -> Option<&'a str>

The name the fight carries of its own: an actor’s name, or the name of a wave’s one mob entry. None for a wave of two entries or more, and for a body with no name.

Source

pub fn entries(&self) -> usize

How many mob entries a wave declares (1 for an actor).

Source

pub fn vulnerable(&self) -> bool

Whether the fight’s standing body can be hurt before any unleash: an actor’s vulnerable; always for a wave, whose bodies are never invulnerable.

Source

pub fn id(&self) -> &'a str

The declared id (wave/<kebab> or actor/<kebab>).

Source

pub fn on_kill(&self) -> Option<&'a OnKill>

The fight’s on_kill bundle, if it declares one (spec-0074).

Source§

impl<'a> Fight<'a>

Source

pub fn bar_title(&self) -> Option<&'a str>

The title the fight’s bar draws: a stated title always wins, otherwise the fight’s own name (spec-0073 §5). None when the fight declares no bar, or when there is nothing to draw, which is DW0910.

Trait Implementations§

Source§

impl<'a> Clone for Fight<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Fight<'a>

Source§

impl<'a> Debug for Fight<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Fight<'a>

§

impl<'a> RefUnwindSafe for Fight<'a>

§

impl<'a> Send for Fight<'a>

§

impl<'a> Sync for Fight<'a>

§

impl<'a> Unpin for Fight<'a>

§

impl<'a> UnsafeUnpin for Fight<'a>

§

impl<'a> UnwindSafe for Fight<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.