[−][src]Struct artifact_lib::Artifact
Helper struct that will store the CardSets and a couple HashMaps for fast indexing
Example Usage
let my_artifact = artifact_lib::Artifact::new(); let named_card = my_artifact.card_from_name("Storm Spirit").unwrap(); let id_card = my_artifact.card_from_id(named_card.card_id).unwrap(); let my_adc = "ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__"; let my_deck = my_artifact.get_deck(my_adc);
Fields
card_sets: Vec<CardSet>
id_map: HashMap<u32, Card>
name_map: HashMap<String, Card>
Methods
impl Artifact
[src]
impl Artifact
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new Artifact object, prepopulated with all the card sets and a couple HashMaps that help with indexing into the card sets
pub fn card_from_name(&self, name: &str) -> Option<&Card>
[src]
pub fn card_from_name(&self, name: &str) -> Option<&Card>
pub fn card_from_name_string(&self, name: &String) -> Option<&Card>
[src]
pub fn card_from_name_string(&self, name: &String) -> Option<&Card>
pub fn card_from_id(&self, id: u32) -> Option<&Card>
[src]
pub fn card_from_id(&self, id: u32) -> Option<&Card>
pub fn get_deck(&self, adc: &str) -> Result<Deck, String>
[src]
pub fn get_deck(&self, adc: &str) -> Result<Deck, String>
Takes in an ADC and returns the corresponding Deck, including Hero reference cards.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Erased for T
impl<T> Erased for T