Skip to main content

CombatEvent

Enum CombatEvent 

Source
pub enum CombatEvent {
Show 22 variants Created { name: String, campaign: String, }, CombatantAdded { combatant: Combatant, }, CombatantRemoved { combatant: Uuid, }, InitiativeRolled { combatant: Uuid, roll: u8, modifier: i8, total: i16, }, InitiativeSet { combatant: Uuid, total: i16, }, Started, RoundStarted { round: u32, }, TurnStarted { combatant: Uuid, }, Damaged { combatant: Uuid, amount: u32, hit_points: HitPoints, }, Healed { combatant: Uuid, amount: u32, hit_points: HitPoints, }, TemporaryHitPointsSet { combatant: Uuid, hit_points: HitPoints, }, EffectAdded { effect: Effect, }, EffectEnded { effect: Uuid, reason: EffectEndReason, }, SpellCast { caster: Uuid, spell: String, slot: Option<SpellSlot>, targets: Vec<Uuid>, }, FeatureUsed { combatant: Uuid, feature: String, amount: u16, }, Paused, Resumed, Ended, Undone { command: Uuid, }, CombatantRestored { combatant: Combatant, }, EffectRestored { effect: Effect, }, ProgressRestored { status: CombatStatus, round: u32, current_turn: Option<Uuid>, },
}
Expand description

Something that happened in a combat. Events are facts: they carry outcomes (the rolled number, the resulting HP) so replaying the log never needs to re-roll or re-decide anything.

Variants§

§

Created

Fields

§name: String
§campaign: String
§

CombatantAdded

Fields

§combatant: Combatant
§

CombatantRemoved

Fields

§combatant: Uuid
§

InitiativeRolled

Fields

§combatant: Uuid
§roll: u8
§modifier: i8
§total: i16
§

InitiativeSet

Fields

§combatant: Uuid
§total: i16
§

Started

§

RoundStarted

Fields

§round: u32
§

TurnStarted

Fields

§combatant: Uuid
§

Damaged

Fields

§combatant: Uuid
§amount: u32
§hit_points: HitPoints
§

Healed

Fields

§combatant: Uuid
§amount: u32
§hit_points: HitPoints
§

TemporaryHitPointsSet

Fields

§combatant: Uuid
§hit_points: HitPoints
§

EffectAdded

Fields

§effect: Effect
§

EffectEnded

Fields

§effect: Uuid
§

SpellCast

A record only: the slot was spent on the caster’s sheet.

Fields

§caster: Uuid
§spell: String
§targets: Vec<Uuid>
§

FeatureUsed

A record; the combat service spends the use on the character’s sheet before logging it.

Fields

§combatant: Uuid
§feature: String
§amount: u16
§

Paused

§

Resumed

§

Ended

§

Undone

The command command was undone. The events after it, from the same undo, put back what that command changed.

Fields

§command: Uuid
§

CombatantRestored

A combatant put back as they were (or with their own command’s change reverted), joining again if they had left.

Fields

§combatant: Combatant
§

EffectRestored

An effect put back, in play again if it had ended.

Fields

§effect: Effect
§

ProgressRestored

Status, round and turn set back.

Fields

§round: u32
§current_turn: Option<Uuid>

Implementations§

Source§

impl CombatEvent

Source

pub fn sheet_cost(&self) -> Option<(Uuid, SheetCost)>

What the command that logged this event cost a sheet: what undoing it gives back.

Trait Implementations§

Source§

impl Clone for CombatEvent

Source§

fn clone(&self) -> CombatEvent

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 ComposeSchema for CombatEvent

Source§

fn compose(generics: Vec<RefOr<Schema>>) -> RefOr<Schema>

Source§

impl Debug for CombatEvent

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CombatEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CombatEvent

Source§

fn eq(&self, other: &CombatEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CombatEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for CombatEvent

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference [utoipa::openapi::schema::Schema]s for this type. Read more
Source§

impl Eq for CombatEvent

Source§

impl StructuralPartialEq for CombatEvent

Auto Trait Implementations§

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,