You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having a discussion over in mtgjson/mtgjson#285 about the best way to get a list of static abilities for a given card. Some examples: Rotting Rats would return ['Unearth'], Anax and Cymede would return ['First Strike', 'Vigilance']
I just finished up a helper function for doing this, and posted it in the issue I mentioned above. I think that would ideally go in this library. If you're interested, I can make a PR for it.
The text was updated successfully, but these errors were encountered:
A query field in the API - This requires a change to magicthegathering.io.
A helper function for the card objects that come back from the API - Naturally implemented in this library.
Regarding the implementation of (2), I can imagine this functionality being provided through an instance method on the card object (card.abilities()) or a static function on the root mtg object (mtg.abilities(card)). An instance method will be most convenient and familiar for the average object-oriented developer. The downside is that it changes the nature of the card object from static data (JSON object) to a hybrid object with both data and a function. This could be problematic for the serialization of card objects, for example.
I would like to hear your input on the above assessment, then I welcome your contribution!
For my app, I'm downloading all the data before runtime, and just loading in a giant json blob, rather than hitting the API every time. So, in my case, I think it'd be more helpful to have this be a static method.
I've been having a discussion over in mtgjson/mtgjson#285 about the best way to get a list of static abilities for a given card. Some examples: Rotting Rats would return
['Unearth']
, Anax and Cymede would return['First Strike', 'Vigilance']
I just finished up a helper function for doing this, and posted it in the issue I mentioned above. I think that would ideally go in this library. If you're interested, I can make a PR for it.
The text was updated successfully, but these errors were encountered: