Skip to content

Conversation

@TheDeveloper101
Copy link

Created a rough method to be able to get a card. But the method requires the name of the card to be passed in as an AbstractCard. Also the method returns an AbstractCard and it would be nice if it could return a string. I am not sure how to make it such that the method will simply return a card from the HashBag but this is what I could come up with

self.mainboard.insert_many(card, count)
}

pub fn get_card(&self, card: &AbstractCard) -> AbstractCard {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt the usefulness of this method. Let's say the deck does contain the given card in the mainboard. You are getting it, cloning it, and returning it to the user. However, the returned card should contain all the same information that the given card does. Based on our conversation elsewhere, I believe you want to add methods on the AbstractCard struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants