Skip to main content

GameState

Struct GameState 

Source
pub struct GameState {
Show 25 fields pub cards: Vec<Card>, pub players: Vec<PlayerState>, pub stack: MagicStack, pub cost_payment_stack: CostPaymentStack, pub is_night: bool, pub day_night_started: bool, pub turn: TurnState, pub player_order: Vec<PlayerId>, pub game_over: bool, pub winner: Option<PlayerId>, pub extra_turns: VecDeque<ExtraTurn>, pub prevent_all_combat_damage: bool, pub monarch: Option<PlayerId>, pub initiative_holder: Option<PlayerId>, pub end_turn_requested: bool, pub end_combat_requested: bool, pub extra_combat_phases: u32, pub pending_damage_map: Option<CardDamageMap>, pub pending_prevent_map: Option<CardDamageMap>, pub pending_change_zone_table: Option<CardZoneTable>, pub synced_token_scripts: BTreeSet<String>, pub last_state_battlefield: Vec<CardSnapshot>, pub pre_sba_battlefield: Vec<CardId>, pub last_sacrificed_card: Option<CardId>, pub counter_added_this_turn: BTreeMap<(GameEntity, Option<u64>, CounterType), i32>, /* private fields */
}
Expand description

The complete, serializable game state. All game entities live here — nothing holds references, everything uses IDs.

Fields§

§cards: Vec<Card>§players: Vec<PlayerState>§stack: MagicStack§cost_payment_stack: CostPaymentStack

Cost payment tracking stack — used by triggers to inspect cost payments. Mirrors Java’s Game.costPaymentStack.

§is_night: bool§day_night_started: bool§turn: TurnState§player_order: Vec<PlayerId>§game_over: bool§winner: Option<PlayerId>§extra_turns: VecDeque<ExtraTurn>§prevent_all_combat_damage: bool§monarch: Option<PlayerId>§initiative_holder: Option<PlayerId>§end_turn_requested: bool§end_combat_requested: bool§extra_combat_phases: u32§pending_damage_map: Option<CardDamageMap>

Shared damage aggregation map for Java-style DamageMap flows. Used across sub-ability chains and consumed by DamageResolve.

§pending_prevent_map: Option<CardDamageMap>

Shared prevention map paired with pending_damage_map.

§pending_change_zone_table: Option<CardZoneTable>

Shared zone-change aggregation table for Java-style ChangeZoneTable flows. Used across sub-ability chains and consumed by ChangeZoneResolve.

§synced_token_scripts: BTreeSet<String>

Token scripts that have already consumed game-RNG for art selection. Java’s TokenDb caches prototypes globally, consuming RNG only on first creation. Subsequent creations of the same token type reuse the cached prototype without RNG. This set mirrors that behavior.

§last_state_battlefield: Vec<CardSnapshot>

Periodic LKI snapshot of battlefield cards. Mirrors Java’s Game.lastStateBattlefield. Updated by copy_last_state() at key game checkpoints.

§pre_sba_battlefield: Vec<CardId>

Snapshot of cards on the battlefield at the start of the current SBA check. Used by DisableTriggers (Hushbringer) to check LKI — a creature that dies in the same batch as another creature still suppresses the other’s death trigger. Mirrors Java’s LastStateBattlefield passed through RunParams. Set at the start of check_state_based_actions_with_triggers, cleared after.

§last_sacrificed_card: Option<CardId>

Last card sacrificed as a cost (for Sacrificed$CardPower SVar resolution). Mirrors Java’s sa.getPaidList("SacrificedCards").

§counter_added_this_turn: BTreeMap<(GameEntity, Option<u64>, CounterType), i32>

Implementations§

Source§

impl GameState

Game state mutation methods — moving cards, dealing damage, state-based actions.

Source

pub fn record_player_damage_assignment( &mut self, source: Option<CardId>, target_player: Option<PlayerId>, amount: i32, is_combat: bool, )

Source

pub fn move_card( &mut self, card_id: CardId, dest_zone: ZoneType, dest_owner: PlayerId, )

Move a card from its current zone to a new zone. Move a card to a new zone. For Graveyard destinations, checks for zone-redirect replacement effects (Rest in Peace, Leyline of the Void) and redirects to the correct zone. Use move_card_final to skip the replacement check.

Source

pub fn move_card_with_agents( &mut self, card_id: CardId, dest_zone: ZoneType, dest_owner: PlayerId, agents: &mut [Box<dyn PlayerAgent>], )

Source

pub fn move_card_with_agents_and_replacement_runtime( &mut self, card_id: CardId, dest_zone: ZoneType, dest_owner: PlayerId, agents: &mut [Box<dyn PlayerAgent>], runtime: &mut ReplacementRuntime<'_>, )

Source

pub fn discard_card( &mut self, card_id: CardId, discard_player: PlayerId, sa: Option<&SpellAbility>, agents: Option<&mut [Box<dyn PlayerAgent>]>, trigger_handler: &mut TriggerHandler, )

Discard a card. Mirrors Java’s Player.discard().

Records the discard, marks the card, and moves it to graveyard through the normal zone-change machinery (which runs replacement effects like Madness automatically). Fires Discarded triggers afterwards.

Source

pub fn deal_damage_to_card(&mut self, target: CardId, amount: i32)

Deal damage to a card (creature).

Runs replacement effects (e.g. damage prevention) before applying. Mirrors Java GameAction.addDamage() calling ReplacementHandler.run().

Source

pub fn deal_damage_to_card_from( &mut self, target: CardId, amount: i32, source: Option<CardId>, is_combat: bool, )

Deal damage to a card with source tracking for replacement effects.

Source

pub fn deal_damage_to_card_from_with_agents( &mut self, target: CardId, amount: i32, source: Option<CardId>, is_combat: bool, agents: Option<&mut [Box<dyn PlayerAgent>]>, )

Deal damage to a card with source tracking and optional agents for RNG parity.

Source

pub fn deal_damage_to_player(&mut self, target: PlayerId, amount: i32) -> i32

Deal damage to a player.

Runs replacement effects (e.g. damage prevention) before applying. Mirrors Java GameAction.addDamage() calling ReplacementHandler.run().

Source

pub fn deal_damage_to_player_from( &mut self, target: PlayerId, amount: i32, source: Option<CardId>, is_combat: bool, ) -> i32

Deal damage to a player with source tracking for replacement effects.

Source

pub fn deal_damage_to_player_from_with_agents( &mut self, target: PlayerId, amount: i32, source: Option<CardId>, is_combat: bool, agents: Option<&mut [Box<dyn PlayerAgent>]>, ) -> i32

Deal damage to a player with source tracking and optional agents for RNG parity. Used by combat damage and spell damage to pass the source card and combat flag so replacement effects like Torbran and Furnace of Rath can check ValidSource$ and IsCombat$.

Source

pub fn check_state_based_actions(&mut self) -> bool

Check and apply state-based actions. Returns true if any were applied.

Source

pub fn check_state_based_actions_with_triggers( &mut self, trigger_handler: Option<&mut TriggerHandler>, legend_keep_fn: Option<&mut dyn FnMut(PlayerId, &[CardId]) -> CardId>, ) -> bool

Check and apply state-based actions. Returns true if any were applied. If provided, emits ChangesZone triggers for SBA zone moves. legend_keep_fn — optional callback for legend rule: given (player, duplicates), returns the CardId to keep. Mirrors Java’s chooseSingleEntityForEffect.

Source

pub fn check_state_based_actions_with_trigger_agents( &mut self, trigger_handler: Option<&mut TriggerHandler>, agents: &mut [Box<dyn PlayerAgent>], ) -> bool

Source

pub fn untap_all(&mut self, player: PlayerId)

Untap all permanents controlled by a player. Runs Untap replacement effects for each permanent.

Source

pub fn draw_card(&mut self, player: PlayerId) -> Option<CardId>

Draw a card for a player. Returns the drawn card ID, or None if the draw was skipped or the library is empty.

Runs Draw replacement effects before drawing. If the draw is replaced (e.g. “skip your draw step”), returns None.

Mirrors Java GameAction.draw() calling ReplacementHandler.run(Draw, …).

Source

pub fn draw_card_with_agents( &mut self, player: PlayerId, agents: &mut [Box<dyn PlayerAgent>], ) -> Option<CardId>

Draw a card with agent access for Optional replacement effects (Dredge).

Source

pub fn draw_cards(&mut self, player: PlayerId, n: usize) -> Vec<CardId>

Draw N cards for a player. Returns drawn card IDs.

Source

pub fn shuffle_library(&mut self, player: PlayerId, rng: &mut impl Rng)

Shuffle a player’s library using the provided RNG.

Source

pub fn new_turn_for_player(&mut self, player: PlayerId)

Reset per-turn state for all cards and players of a given player.

Source

pub fn tap(&mut self, card_id: CardId) -> bool

Tap a card. Returns true if it was untapped. Runs Tap replacement effects before tapping.

Source

pub fn untap(&mut self, card_id: CardId) -> bool

Untap a card. Returns true if it was tapped. Runs Untap replacement effects before untapping.

Source

pub fn untap_during_untap_step( &mut self, card_id: CardId, player: PlayerId, ) -> bool

Source

pub fn change_controller(&mut self, card_id: CardId, new_controller: PlayerId)

Change the controller of a permanent to new_controller. Mirrors Java’s GameAction.controllerChangeZoneCorrection() — moves the card between per-player zone lists and updates the controller field.

Source

pub fn attach_to(&mut self, aura_id: CardId, target_id: CardId)

Attach aura_id to target_id. If aura_id was already attached elsewhere, detach it first. Mirrors Java’s Card.enchantEntity() / Card.equip().

Source

pub fn attach_to_player(&mut self, aura_id: CardId, player_id: PlayerId)

Source

pub fn detach(&mut self, aura_id: CardId)

Detach aura_id from whatever it is currently attached to. Mirrors Java’s Card.unattachFromEntity().

Source

pub fn put_on_bottom_of_library(&mut self, card_id: CardId, owner: PlayerId)

Move a card from its current zone to the bottom of a player’s library. Unlike move_card, this places the card at the bottom rather than the top.

Source

pub fn remove_from_stack(&mut self, entry_id: u32) -> bool

Remove a spell from the stack by its entry ID (used by Counter). Mirrors Java’s Game.getStack().remove(sa).

Source§

impl GameState

Source

pub fn new(player_names: &[&str], starting_life: i32) -> Self

Source

pub fn create_card(&mut self, card: Card) -> CardId

Create a new card instance and return its ID. Does NOT place it in a zone.

Source

pub fn card(&self, id: CardId) -> &Card

Source

pub fn card_mut(&mut self, id: CardId) -> &mut Card

Source

pub fn player(&self, id: PlayerId) -> &PlayerState

Source

pub fn player_mut(&mut self, id: PlayerId) -> &mut PlayerState

Source

pub fn zone(&self, zone_type: ZoneType, owner: PlayerId) -> &Zone

Source

pub fn zone_mut(&mut self, zone_type: ZoneType, owner: PlayerId) -> &mut Zone

Source

pub fn zone_store_snapshot(&self) -> ZoneStore

Source

pub fn replace_zone_store(&mut self, zones: ZoneStore)

Source

pub fn iter_zones(&self) -> impl Iterator<Item = (ZoneKey, &Zone)>

Source

pub fn cards_in_all_zones( &self, zone_type: ZoneType, ) -> impl Iterator<Item = CardId> + '_

Source

pub fn card_zone_location(&self, card: CardId) -> Option<ZoneKey>

Source

pub fn card_zone(&self, card: CardId) -> Option<ZoneType>

Source

pub fn card_current_zone(&self, card: CardId) -> ZoneType

Source

pub fn card_is_in_zone(&self, card: CardId, zone: ZoneType) -> bool

Source

pub fn card_zone_owner(&self, card: CardId) -> Option<PlayerId>

Source

pub fn card_zone_location_matches_card(&self, card: CardId) -> bool

Source

pub fn reset_zone_turn_tracking(&mut self)

Source

pub fn reset_card_turn_tracking(&mut self)

Source

pub fn counter_added_this_turn( &self, entity: GameEntity, counter_type: Option<&CounterType>, ) -> i32

Source

pub fn record_counter_added( &mut self, entity: GameEntity, counter_type: &CounterType, amount: i32, )

Source

pub fn take_top_card_from_zone( &mut self, zone_type: ZoneType, owner: PlayerId, ) -> Option<CardId>

Source

pub fn take_top_cards_from_zone( &mut self, zone_type: ZoneType, owner: PlayerId, count: usize, ) -> Vec<CardId>

Source

pub fn reorder_card_in_zone( &mut self, zone_type: ZoneType, owner: PlayerId, card: CardId, index: usize, )

Source

pub fn move_cards_to_zone_top( &mut self, zone_type: ZoneType, owner: PlayerId, cards: &[CardId], )

Source

pub fn move_cards_to_zone_bottom( &mut self, zone_type: ZoneType, owner: PlayerId, cards: &[CardId], )

Source

pub fn replace_zone_cards( &mut self, zone_type: ZoneType, owner: PlayerId, cards: Vec<CardId>, )

Source

pub fn shuffle_zone_cards( &mut self, zone_type: ZoneType, owner: PlayerId, rng: &mut dyn GameRng, )

Source

pub fn shuffle_zone_cards_with_rand<R: Rng + ?Sized>( &mut self, zone_type: ZoneType, owner: PlayerId, rng: &mut R, )

Source

pub fn active_player(&self) -> PlayerId

Source

pub fn is_day(&self) -> bool

Source

pub fn is_neither_day_nor_night(&self) -> bool

Source

pub fn next_player(&self, player: PlayerId) -> PlayerId

Source

pub fn last_combat_turn_of(&self, player: PlayerId) -> Option<i32>

Return the turn number of player’s most recent combat phase, if known. Used by Charm$ ChoiceRestriction$ YourLastCombat.

The Rust engine doesn’t yet persist last-combat timestamps per player, so this is a best-effort: it returns the current turn number iff that turn’s active player is player and we’re past the combat phase. Cards that rely on cross-turn last-combat tracking will treat the restriction as always satisfied (safer than never).

Source

pub fn opponent_of(&self, player: PlayerId) -> PlayerId

Source

pub fn alive_players(&self) -> Vec<PlayerId>

Source

pub fn cards_in_zone(&self, zone_type: ZoneType, owner: PlayerId) -> &[CardId]

Get all cards in a specific zone for a player.

Source

pub fn creatures_on_battlefield(&self, player: PlayerId) -> Vec<CardId>

Get all creatures on the battlefield for a player.

Source

pub fn assign_zone_timestamp(&mut self, card_id: CardId) -> u64

Assign the next zone timestamp to a card, returning the value. Called whenever a card enters a new zone to track insertion order.

Source

pub fn next_effect_timestamp(&mut self) -> i64

Return the next monotonic effect timestamp.

Source

pub fn ensure_pending_damage_maps(&mut self)

Ensure shared damage/prevent maps exist for this resolution scope.

Source

pub fn clear_pending_damage_maps(&mut self)

Clear shared damage/prevent maps.

Source

pub fn ensure_pending_change_zone_table(&mut self)

Ensure a shared zone-change table exists for this resolution scope.

Source

pub fn clear_pending_change_zone_table(&mut self)

Clear the shared zone-change table.

Source

pub fn lands_on_battlefield(&self, player: PlayerId) -> Vec<CardId>

Get all lands on the battlefield for a player.

Source§

impl GameState

LKI methods for GameState. Implemented in this module to keep all LKI logic centralized.

Source

pub fn copy_last_state(&mut self)

Snapshot all battlefield cards for LKI. Mirrors Java’s Game.copyLastState(). Called at phase transitions, before SBAs, before combat.

Source

pub fn get_lki_snapshot(&self, card_id: CardId) -> Option<&CardSnapshot>

Look up a card’s LKI snapshot from the last battlefield state. Returns None if the card wasn’t on the battlefield at the last checkpoint.

Source

pub fn update_lki_snapshot(&mut self, card_id: CardId)

Update the LKI snapshot for a specific card on the battlefield. If the card is already in the snapshot, update it. Otherwise, add it. Called when a card enters the battlefield or its state changes significantly. Mirrors Java’s incremental LKI updates between full copyLastState() calls.

Source§

impl GameState

Source

pub fn player_register_commander(&mut self, player: PlayerId, commander: CardId)

Source

pub fn player_remove_commander(&mut self, player: PlayerId, commander: CardId)

Source

pub fn player_reset_commander_state(&mut self, player: PlayerId)

Source

pub fn player_registered_commanders(&self, player: PlayerId) -> &[CardId]

Source

pub fn player_is_commander(&self, player: PlayerId, card: CardId) -> bool

Source

pub fn player_commander_cast_count( &self, player: PlayerId, commander: CardId, ) -> u32

Source

pub fn player_commander_tax(&self, player: PlayerId, commander: CardId) -> i32

Source

pub fn player_total_commander_casts(&self, player: PlayerId) -> u32

Source

pub fn player_increment_commander_cast( &mut self, player: PlayerId, commander: CardId, )

Source

pub fn player_commander_color_identity(&self, player: PlayerId) -> Vec<String>

Source

pub fn player_create_commander_effect( &mut self, player: PlayerId, _trigger_handler: Option<&mut TriggerHandler>, ) -> Option<CardId>

Source

pub fn player_set_commander_replacement_suppressed( &mut self, player: PlayerId, suppressed: bool, )

Source

pub fn player_remove_commander_effect(&mut self, player: PlayerId)

Source

pub fn initialize_player_commanders_from_registered( &mut self, player: PlayerId, registered: &RegisteredPlayer, trigger_handler: Option<&mut TriggerHandler>, )

Source§

impl GameState

Source

pub fn new_from_registered_players(players: &[RegisteredPlayer]) -> Self

Source

pub fn initialize_registered_player_cards( &mut self, player: PlayerId, registered: &RegisteredPlayer, cards: Vec<(CardInstance, ZoneType)>, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn player_register_radiation_effect( &mut self, player: PlayerId, trigger_handler: &mut TriggerHandler, )

Source

pub fn player_cleanup_turn_state(&mut self, player: PlayerId)

Source

pub fn player_mark_lost(&mut self, player: PlayerId, reason: GameLossReason)

Source

pub fn player_mark_won(&mut self, player: PlayerId)

Source

pub fn player_alt_win_by_spell_effect( &mut self, player: PlayerId, source_name: Option<String>, )

Source

pub fn player_concede(&mut self, player: PlayerId)

Source

pub fn player_clear_outcome(&mut self, player: PlayerId)

Source

pub fn player_reset_for_restart(&mut self, player: PlayerId)

Source

pub fn player_set_controlled_by( &mut self, player: PlayerId, controller: Option<PlayerId>, )

Source

pub fn player_add_skip_turns(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_decrement_skip_turns(&mut self, player: PlayerId)

Source

pub fn player_set_monarch( &mut self, player: PlayerId, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn player_take_initiative( &mut self, player: PlayerId, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn player_set_ring_bearer( &mut self, player: PlayerId, bearer: Option<CardId>, )

Source

pub fn player_set_blessing(&mut self, player: PlayerId, value: bool)

Source

pub fn player_ring_tempt(&mut self, player: PlayerId)

Source

pub fn player_add_poison(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_remove_poison(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_add_energy(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_can_pay_energy(&self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_lose_energy(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_pay_energy(&mut self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_add_shards(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_can_pay_shards(&self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_lose_shards(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_pay_shards(&mut self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_add_radiation(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_remove_radiation(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_set_radiation(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_gain_life(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_can_gain_life(&self, player: PlayerId) -> bool

Source

pub fn player_lose_life(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_deal_damage(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_can_lose_life(&self, player: PlayerId) -> bool

Source

pub fn player_can_pay_life(&self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_pay_life(&mut self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_set_life(&mut self, player: PlayerId, amount: i32) -> i32

Source

pub fn player_exchange_life_totals(&mut self, a: PlayerId, b: PlayerId)

Source

pub fn player_add_damage_prevention(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_clear_damage_prevention(&mut self, player: PlayerId)

Source

pub fn player_record_land_play(&mut self, player: PlayerId)

Source

pub fn player_add_team_life_gained(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_record_permanent_left_battlefield(&mut self, player: PlayerId)

Source

pub fn player_record_landfall(&mut self, player: PlayerId)

Source

pub fn player_record_permanent_put_into_graveyard(&mut self, player: PlayerId)

Source

pub fn player_add_mana_expended(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_set_mana_expended(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_record_discard(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_record_explore(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_record_roll(&mut self, player: PlayerId, result: Option<i32>)

Source

pub fn player_record_attraction_visit(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_clear_skip_untap(&mut self, player: PlayerId)

Source

pub fn player_clear_skip_draw(&mut self, player: PlayerId)

Source

pub fn player_clear_skip_combat(&mut self, player: PlayerId)

Source

pub fn player_set_skip_untap(&mut self, player: PlayerId)

Source

pub fn player_set_skip_draw(&mut self, player: PlayerId)

Source

pub fn player_set_skip_combat(&mut self, player: PlayerId)

Source

pub fn player_attack_combat_reset(&mut self, player: PlayerId)

Source

pub fn player_record_attacked_player( &mut self, player: PlayerId, defender: PlayerId, )

Source

pub fn player_apply_mana_burn(&mut self, player: PlayerId, amount: i32)

Source

pub fn player_set_speed_effect( &mut self, player: PlayerId, effect_id: Option<CardId>, )

Source

pub fn player_set_speed( &mut self, player: PlayerId, speed: i32, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn increase_player_speed( &mut self, player: PlayerId, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn decrease_player_speed( &mut self, player: PlayerId, trigger_handler: Option<&mut TriggerHandler>, )

Source

pub fn player_add_commander_damage( &mut self, player: PlayerId, commander: CardId, amount: i32, )

Source

pub fn player_record_damage_assignment( &mut self, source: Option<CardId>, target_player: Option<PlayerId>, amount: i32, is_combat: bool, )

Source

pub fn player_draw_one(&mut self, player: PlayerId) -> Option<CardId>

Source

pub fn player_draw_one_for_turn(&mut self, player: PlayerId) -> Option<CardId>

Draw a card for the draw step (sets is_first_in_draw_step: true).

Source

pub fn player_draw_one_for_turn_with_agents( &mut self, player: PlayerId, agents: &mut [Box<dyn PlayerAgent>], ) -> Option<CardId>

Draw a card for the draw step with agent access for Optional replacement effects (Dredge). Mirrors Java’s draw path which calls confirmReplacementEffect through the replacement handler.

Source

pub fn player_can_draw(&self, player: PlayerId) -> bool

Source

pub fn player_can_draw_amount(&self, player: PlayerId, amount: i32) -> bool

Source

pub fn player_draw_cards( &mut self, player: PlayerId, amount: usize, ) -> Vec<CardId>

Source

pub fn player_shuffle_library(&mut self, player: PlayerId, rng: &mut impl Rng)

Source

pub fn player_record_spell_cast(&mut self, player: PlayerId, card_id: CardId)

Source

pub fn player_hand_count(&self, player: PlayerId) -> usize

Source

pub fn player_graveyard_count(&self, player: PlayerId) -> usize

Source

pub fn player_graveyard_type_count(&self, player: PlayerId) -> usize

Source

pub fn player_has_hellbent(&self, player: PlayerId) -> bool

Source

pub fn player_has_threshold(&self, player: PlayerId) -> bool

Source

pub fn player_has_metalcraft(&self, player: PlayerId) -> bool

Source

pub fn player_has_delirium(&self, player: PlayerId) -> bool

Source

pub fn player_has_ferocious(&self, player: PlayerId) -> bool

Source

pub fn player_has_desert(&self, player: PlayerId) -> bool

Source

pub fn player_has_blessing(&self, player: PlayerId) -> bool

Source

pub fn player_has_revolt(&self, player: PlayerId) -> bool

Source

pub fn player_has_landfall(&self, player: PlayerId) -> bool

Source

pub fn player_has_descended(&self, player: PlayerId) -> bool

Source

pub fn player_controls_urza_lands(&self, player: PlayerId) -> bool

Source

pub fn player_opponents_lost_life_this_turn(&self, player: PlayerId) -> bool

Source

pub fn player_has_bloodthirst(&self, player: PlayerId) -> bool

Source

pub fn player_can_surge(&self, player: PlayerId) -> bool

Source

pub fn player_spells_cast_this_turn(&self, player: PlayerId) -> i32

Source

pub fn player_storm_count(&self, _player: PlayerId) -> i32

Source

pub fn player_reset_drawn_this_turn(&mut self, player: PlayerId)

Source

pub fn player_new_turn(&mut self, player: PlayerId)

Source

pub fn player_check_lose_condition(&mut self, player: PlayerId) -> bool

Trait Implementations§

Source§

impl Clone for GameState

Source§

fn clone(&self) -> GameState

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 Debug for GameState

Source§

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

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

impl<'de> Deserialize<'de> for GameState

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 GameState

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§

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

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

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

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V