pub struct DetachedCardEffect {
pub id: CardId,
pub linked_card: Option<CardId>,
pub owner: PlayerId,
pub name: String,
}Expand description
A detached card effect — an effect card that is not attached to any permanent but acts independently (e.g., commander zone effects, emblems).
Fields§
§id: CardIdThe ID of this effect “card” in the game state.
linked_card: Option<CardId>The card this effect is linked to (if any).
owner: PlayerIdThe owner/controller of this effect.
name: StringDisplay name for this effect.
Implementations§
Source§impl DetachedCardEffect
impl DetachedCardEffect
Sourcepub fn new(
id: CardId,
linked_card: CardId,
owner: PlayerId,
name: String,
) -> Self
pub fn new( id: CardId, linked_card: CardId, owner: PlayerId, name: String, ) -> Self
Create a new detached card effect linked to a source card.
Sourcepub fn new_unlinked(id: CardId, owner: PlayerId, name: String) -> Self
pub fn new_unlinked(id: CardId, owner: PlayerId, name: String) -> Self
Create a new detached card effect with no linked card.
Sourcepub fn card_for_ui(&self) -> Option<CardId>
pub fn card_for_ui(&self) -> Option<CardId>
Get the card to display in the UI (the linked card, if any).
Trait Implementations§
Source§impl Clone for DetachedCardEffect
impl Clone for DetachedCardEffect
Source§fn clone(&self) -> DetachedCardEffect
fn clone(&self) -> DetachedCardEffect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DetachedCardEffect
impl RefUnwindSafe for DetachedCardEffect
impl Send for DetachedCardEffect
impl Sync for DetachedCardEffect
impl Unpin for DetachedCardEffect
impl UnsafeUnpin for DetachedCardEffect
impl UnwindSafe for DetachedCardEffect
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.