jamuraa / gatherling

Magic: The Gathering tournament runner and tracker for Pauper Magic
http://pdcmagic.com/gatherling
MIT License
11 stars 11 forks source link

Card structure does not have enough fields to contain all card data #41

Open Dabil opened 12 years ago

Dabil commented 12 years ago

Need to add fields to contain all of the card data. In this way the database can be used to replace the deckbox functions that show the card pic in a little pop-up box when you hover over the card name. Also will be able to develop a deck editor on the site. That way it makes it easy for people to build decks for alt formats and other crazy formats we may want to run.

Thinking the new structure should be:

name: varchar(40) // name of card cardset: varchar(40) // card set card is from type: varchar(40) // type of card: Instant, Sorcery, Land, Creature, etc. pow/Tgh: varchar(40) // Power and toughness of creatures
cost: varchar(40) // Mana cost of card. rarity:varchar(40) // lists rarity of cards common, uncommon, rare, mythic. rules:varchar(200) // Contains card text. ex. T: Draw a card and discard a card. flavor: varchar(200) // Contains flavor text of card ID:bigint(20) unsigned // Card ID: image:varchar(40) // Card Image file name, card images should be in a directory inside of Gatherling

Do away with fields:

isw, isr, isg, isu, isb, isp, convertedcost: all these fields can be calculated from the cost field.

jamuraa commented 12 years ago

There's an argument for converted cost being in the database because it is non-trivial to calculate it, especially for big sets of cards. Colors are definitely easy to calculate from the mana cost though.

I'm not sure about having all of these, rather than using a service which would provide them. It seems like there should be a API out there that we can use.

Michael Janssen --- Jamuraa --- jamuraa@base0.net

On Fri, Feb 17, 2012 at 12:50 PM, Dabil reply@reply.github.com wrote:

Need to add fields to contain all of the card data. In this way the database can be used to replace the deckbox functions that show the card pic in a little pop-up box when you hover over the card name. Also will be able to develop a deck editor on the site. That way it makes it easy for people to build decks for alt formats and other crazy formats we may want to run.

Thinking the new structure should be:

name: varchar(40)                        // name of card cardset: varchar(40)                     // card set card is from type: varchar(40)                           // type of card: Instant, Sorcery, Land, Creature, etc. pow/Tgh: varchar(40)                   // Power and toughness of creatures cost: varchar(40)                          // Mana cost of card. rarity:varchar(40)                          // lists rarity of cards common, uncommon, rare, mythic. rules:varchar(200)                       // Contains card text. ex. T: Draw a card and discard a card. flavor: varchar(200)                      // Contains flavor text of card ID:bigint(20) unsigned                // Card ID: image:varchar(40)                       // Card Image file name, card images should be in a directory inside of Gatherling

Do away with fields:

isw, isr, isg, isu, isb, isp, convertedcost: all these fields can be calculated from the cost field.


Reply to this email directly or view it on GitHub: https://github.com/jamuraa/gatherling/issues/41

Dabil commented 12 years ago

The problem with API's is, unless they are open source, you are stuck with what they allow you to do. So you have to make sure you aren't going to want to deviate from their functionality in the future. I personally like to have my own code base. Then I am completely in control.

jamuraa commented 12 years ago

It's pretty easy to assume that we can get all of the basic card info from an API, especially for things like this. I'm not advocating using an API for every part of the card, but only pulling the things into the database that we have an actual need for functionality wise.

(It really bugs me that every MTG site has to have it's own, separate, database that's just slghtly different, can you tell? :) )

Michael Janssen --- Jamuraa --- jamuraa@base0.net

On Fri, Feb 17, 2012 at 3:26 PM, Dabil reply@reply.github.com wrote:

The problem with API's is, unless they are open source, you are stuck with what they allow you to do. So you have to make sure you aren't going to want to deviate from their functionality in the future. I personally like to have my own code base. Then I am completely in control.


Reply to this email directly or view it on GitHub: https://github.com/jamuraa/gatherling/issues/41#issuecomment-4028141