pub struct Cost {
pub parts: Vec<CostPart>,
pub has_tap: bool,
pub mandatory: bool,
}Expand description
The complete cost to activate an ability.
Fields§
§parts: Vec<CostPart>§has_tap: bool§mandatory: boolImplementations§
Source§impl Cost
impl Cost
pub fn has_tap_cost(&self) -> bool
pub fn has_no_mana_cost(&self) -> bool
pub fn has_mana_cost(&self) -> bool
pub fn has_specific_cost_type(&self, probe: &CostPart) -> bool
pub fn has_only_specific_cost_type(&self, probe: &CostPart) -> bool
pub fn sort(&mut self)
pub fn copy(&self) -> Self
pub fn copy_with_no_mana(&self) -> Self
pub fn copy_with_defined_mana(&self, mana_cost: ManaCost) -> Self
pub fn refund_paid_cost( &self, game: &mut GameState, source: CardId, player: PlayerId, )
pub fn to_string_alt(&self) -> String
pub fn to_simple_string(&self) -> String
pub fn is_zero_cost(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cost
impl<'de> Deserialize<'de> for Cost
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Cost
impl RefUnwindSafe for Cost
impl Send for Cost
impl Sync for Cost
impl Unpin for Cost
impl UnsafeUnpin for Cost
impl UnwindSafe for Cost
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.