Event

Enum Event 

Source
pub enum Event {
Show 48 variants Draw { player: u8, card: CardId, }, Damage { player: u8, card: CardId, }, DamageCancel { player: u8, }, DamageIntent { event_id: u32, source_player: u8, source_slot: Option<u8>, target: u8, amount: i32, damage_type: DamageType, cancelable: bool, }, DamageModifierApplied { event_id: u32, modifier: DamageModifierKind, before_amount: i32, after_amount: i32, before_cancelable: bool, after_cancelable: bool, before_canceled: bool, after_canceled: bool, }, DamageModified { event_id: u32, target: u8, original: i32, modified: i32, canceled: bool, damage_type: DamageType, }, DamageCommitted { event_id: u32, target: u8, card: CardId, damage_type: DamageType, }, ReversalCommitted { player: u8, slot: u8, cause_damage_event: Option<u32>, }, Reveal { player: u8, card: CardId, reason: RevealReason, audience: RevealAudience, }, TriggerQueued { trigger_id: u32, group_id: u32, player: u8, source: CardId, effect: TriggerEffect, }, TriggerGrouped { group_id: u32, trigger_ids: Vec<u32>, }, TriggerResolved { trigger_id: u32, player: u8, effect: TriggerEffect, }, TriggerCanceled { trigger_id: u32, player: u8, reason: TriggerCancelReason, }, TimingWindowEntered { window: TimingWindow, player: u8, }, PriorityGranted { window: TimingWindow, player: u8, }, PriorityPassed { player: u8, window: TimingWindow, pass_count: u8, }, StackGroupPresented { group_id: u32, controller: u8, items: Vec<StackItem>, }, StackOrderChosen { group_id: u32, controller: u8, stack_id: u32, }, StackPushed { item: StackItem, }, StackResolved { item: StackItem, }, AutoResolveCapExceeded { cap: u32, stack_len: u32, window: Option<TimingWindow>, }, WindowAdvanced { from: TimingWindow, to: Option<TimingWindow>, }, ChoicePresented { choice_id: u32, player: u8, reason: ChoiceReason, options: Vec<ChoiceOptionSnapshot>, total_candidates: u16, page_start: u16, }, ChoicePageChanged { choice_id: u32, player: u8, from_start: u16, to_start: u16, }, ChoiceMade { choice_id: u32, player: u8, reason: ChoiceReason, option: ChoiceOptionRef, }, ChoiceAutopicked { choice_id: u32, player: u8, reason: ChoiceReason, option: ChoiceOptionRef, }, ChoiceSkipped { choice_id: u32, player: u8, reason: ChoiceReason, skip_reason: ChoiceSkipReason, }, ZoneMove { player: u8, card: CardId, from: Zone, to: Zone, from_slot: Option<u8>, to_slot: Option<u8>, }, ControlChanged { card: CardId, owner: u8, from_controller: u8, to_controller: u8, from_slot: u8, to_slot: u8, }, ModifierAdded { id: u32, source: CardId, target_player: u8, target_slot: u8, target_card: CardId, kind: ModifierKind, magnitude: i32, duration: ModifierDuration, }, ModifierRemoved { id: u32, reason: ModifierRemoveReason, }, Concede { player: u8, }, Play { player: u8, card: CardId, slot: u8, }, PlayEvent { player: u8, card: CardId, }, PlayClimax { player: u8, card: CardId, }, Trigger { player: u8, icon: TriggerIcon, card: Option<CardId>, }, Attack { player: u8, slot: u8, }, AttackType { player: u8, attacker_slot: u8, attack_type: AttackType, }, Counter { player: u8, card: CardId, power: i32, }, Clock { player: u8, card: Option<CardId>, }, Shuffle { player: u8, zone: Zone, }, Refresh { player: u8, }, RefreshPenalty { player: u8, card: CardId, }, LevelUpChoice { player: u8, card: CardId, }, Encore { player: u8, slot: u8, kept: bool, }, Stand { player: u8, }, EndTurn { player: u8, }, Terminal { winner: Option<u8>, },
}
Expand description

Canonical event stream emitted by the engine.

Variants§

§

Draw

Player drew a card.

Fields

§player: u8

Player index.

§card: CardId

Card id drawn.

§

Damage

Card was revealed during a damage check (damage resolution).

Fields

§player: u8

Player receiving damage.

§card: CardId

Card id revealed.

§

DamageCancel

Damage was canceled.

Fields

§player: u8

Player receiving damage.

§

DamageIntent

Damage intent before modifiers/cancel resolution.

Fields

§event_id: u32

Stable event id for correlating downstream damage events.

§source_player: u8

Source player (if known).

§source_slot: Option<u8>

Source stage slot (if known).

§target: u8

Target player.

§amount: i32

Intended damage amount.

§damage_type: DamageType

Damage classification (battle vs effect damage).

§cancelable: bool

Whether damage can be canceled by revealing a climax.

§

DamageModifierApplied

A damage modifier was applied.

Fields

§event_id: u32

Correlated damage event id.

§modifier: DamageModifierKind

Modifier kind applied.

§before_amount: i32

Amount before modifier.

§after_amount: i32

Amount after modifier.

§before_cancelable: bool

Cancelable flag before modifier.

§after_cancelable: bool

Cancelable flag after modifier.

§before_canceled: bool

Canceled flag before modifier.

§after_canceled: bool

Canceled flag after modifier.

§

DamageModified

Damage amount/cancel state was modified and finalized.

Fields

§event_id: u32

Correlated damage event id.

§target: u8

Target player.

§original: i32

Original damage amount.

§modified: i32

Modified damage amount.

§canceled: bool

Whether damage was canceled.

§damage_type: DamageType

Damage classification (battle vs effect damage).

§

DamageCommitted

Damage was committed (a damage card moved to clock).

Fields

§event_id: u32

Correlated damage event id.

§target: u8

Target player.

§card: CardId

Damage card id committed.

§damage_type: DamageType

Damage classification (battle vs effect damage).

§

ReversalCommitted

A battle reversal was committed for a stage slot.

Fields

§player: u8

Player index.

§slot: u8

Stage slot index.

§cause_damage_event: Option<u32>

Damage event id which caused the reversal (if applicable).

§

Reveal

A card was revealed (with reason/audience metadata).

Fields

§player: u8

Player index.

§card: CardId

Card id revealed.

§reason: RevealReason

Reason for the reveal.

§audience: RevealAudience

Audience allowed to see the revealed card.

§

TriggerQueued

A trigger was queued for resolution.

Fields

§trigger_id: u32

Stable trigger id.

§group_id: u32

Trigger group id for simultaneous triggers.

§player: u8

Player index.

§source: CardId

Source card id.

§effect: TriggerEffect

Trigger effect kind.

§

TriggerGrouped

Multiple triggers were grouped for resolution ordering.

Fields

§group_id: u32

Trigger group id.

§trigger_ids: Vec<u32>

Trigger ids in the group.

§

TriggerResolved

Trigger was resolved.

Fields

§trigger_id: u32

Stable trigger id.

§player: u8

Player index.

§effect: TriggerEffect

Trigger effect kind.

§

TriggerCanceled

Trigger was canceled.

Fields

§trigger_id: u32

Stable trigger id.

§player: u8

Player index.

§reason: TriggerCancelReason

Cancellation reason.

§

TimingWindowEntered

A timing window was entered.

Fields

§window: TimingWindow

Timing window.

§player: u8

Active player index.

§

PriorityGranted

Priority was granted to a player within a timing window.

Fields

§window: TimingWindow

Timing window.

§player: u8

Player index.

§

PriorityPassed

Priority was passed by a player.

Fields

§player: u8

Player index.

§window: TimingWindow

Timing window.

§pass_count: u8

Pass count within the window.

§

StackGroupPresented

Stack group was presented for ordering/selection.

Fields

§group_id: u32

Stable group id.

§controller: u8

Player index controlling the stack group.

§items: Vec<StackItem>

Items in the stack group.

§

StackOrderChosen

Stack order was chosen for a presented stack group.

Fields

§group_id: u32

Stable group id.

§controller: u8

Player index controlling the stack group.

§stack_id: u32

Stack id chosen.

§

StackPushed

A stack item was pushed.

Fields

§item: StackItem

Stack item pushed.

§

StackResolved

A stack item was resolved.

Fields

§item: StackItem

Stack item resolved.

§

AutoResolveCapExceeded

Automatic resolution cap was exceeded.

Fields

§cap: u32

Cap value.

§stack_len: u32

Stack length at the time of cap exceed.

§window: Option<TimingWindow>

Timing window (if known).

§

WindowAdvanced

Timing window advanced.

Fields

§from: TimingWindow

Previous timing window.

§to: Option<TimingWindow>

Next timing window (or None if leaving timing windows).

§

ChoicePresented

A choice was presented to a player.

Fields

§choice_id: u32

Stable choice id.

§player: u8

Player index.

§reason: ChoiceReason

Reason for the choice.

§options: Vec<ChoiceOptionSnapshot>

Current page options.

§total_candidates: u16

Total candidate count (before paging).

§page_start: u16

Page start index.

§

ChoicePageChanged

A choice page was changed.

Fields

§choice_id: u32

Stable choice id.

§player: u8

Player index.

§from_start: u16

Previous page start index.

§to_start: u16

New page start index.

§

ChoiceMade

A player made a choice selection.

Fields

§choice_id: u32

Stable choice id.

§player: u8

Player index.

§reason: ChoiceReason

Reason for the choice.

§option: ChoiceOptionRef

Selected option reference.

§

ChoiceAutopicked

A choice was autopicked by the engine.

Fields

§choice_id: u32

Stable choice id.

§player: u8

Player index.

§reason: ChoiceReason

Reason for the choice.

§option: ChoiceOptionRef

Selected option reference.

§

ChoiceSkipped

A choice was skipped.

Fields

§choice_id: u32

Stable choice id.

§player: u8

Player index.

§reason: ChoiceReason

Reason for the choice.

§skip_reason: ChoiceSkipReason

Skip reason.

§

ZoneMove

A card moved between zones.

Fields

§player: u8

Player index.

§card: CardId

Card id moved.

§from: Zone

Source zone.

§to: Zone

Destination zone.

§from_slot: Option<u8>

Source slot (if applicable).

§to_slot: Option<u8>

Destination slot (if applicable).

§

ControlChanged

Control of a card changed.

Fields

§card: CardId

Card id whose controller changed.

§owner: u8

Owner player index.

§from_controller: u8

Previous controller index.

§to_controller: u8

New controller index.

§from_slot: u8

Previous stage slot index.

§to_slot: u8

New stage slot index.

§

ModifierAdded

A modifier was added.

Fields

§id: u32

Modifier id.

§source: CardId

Source card id.

§target_player: u8

Target player index.

§target_slot: u8

Target stage slot index.

§target_card: CardId

Target card id.

§kind: ModifierKind

Modifier kind.

§magnitude: i32

Signed modifier magnitude.

§duration: ModifierDuration

Modifier duration.

§

ModifierRemoved

A modifier was removed.

Fields

§id: u32

Modifier id.

§reason: ModifierRemoveReason

Removal reason.

§

Concede

Player conceded the game.

Fields

§player: u8

Player index.

§

Play

Player played a character to a stage slot.

Fields

§player: u8

Player index.

§card: CardId

Card id played.

§slot: u8

Stage slot index.

§

PlayEvent

Player played an event card.

Fields

§player: u8

Player index.

§card: CardId

Event card id played.

§

PlayClimax

Player played a climax card.

Fields

§player: u8

Player index.

§card: CardId

Climax card id played.

§

Trigger

Trigger step processed a trigger icon.

Fields

§player: u8

Player index.

§icon: TriggerIcon

Trigger icon.

§card: Option<CardId>

Triggered card id (if present).

§

Attack

Player declared an attack with a slot.

Fields

§player: u8

Player index.

§slot: u8

Attacker stage slot index.

§

AttackType

Attack type was chosen (frontal/side/direct).

Fields

§player: u8

Player index.

§attacker_slot: u8

Attacker stage slot index.

§attack_type: AttackType

Declared attack type.

§

Counter

Player played a counter (backup) during counter step.

Fields

§player: u8

Player index.

§card: CardId

Counter card id.

§power: i32

Power granted by the counter.

§

Clock

A card was placed into clock (e.g., from hand or damage).

Fields

§player: u8

Player index.

§card: Option<CardId>

Card id placed into clock (if known).

§

Shuffle

A zone was shuffled.

Fields

§player: u8

Player index.

§zone: Zone

Zone shuffled.

§

Refresh

Refresh occurred (deck refilled from waiting room).

Fields

§player: u8

Player index.

§

RefreshPenalty

Refresh penalty card was applied to clock.

Fields

§player: u8

Player index.

§card: CardId

Card id moved to clock as penalty.

§

LevelUpChoice

Level-up choice was made.

Fields

§player: u8

Player index.

§card: CardId

Card id selected for level.

§

Encore

Encore resolution occurred for a stage slot.

Fields

§player: u8

Player index.

§slot: u8

Stage slot index.

§kept: bool

Whether the character was kept (encored) on stage.

§

Stand

Stand phase occurred for a player.

Fields

§player: u8

Player index.

§

EndTurn

Turn ended for a player.

Fields

§player: u8

Player index.

§

Terminal

Terminal game event.

Fields

§winner: Option<u8>

Winner player index, or None for draw/timeout.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

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

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

impl<'de> Deserialize<'de> for Event

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 Serialize for Event

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

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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>,