card db split in two
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
card db split in two
by Max mtg » 16 Feb 2013, 00:53
The former singleton carddb has now two instances. One keeps all common cards, another one is used for avatars, planes and schemes. When requesting a card from that storage you'll have to specify exactly which kind of card you mean.
Pros:
You may have avatar and creature with same name!
Schemes won't get in random decks for sure inless you've used that special store to get them.
Cons:
Extra efforts when looking for a card of unknown type (hope i wrote enough code to workaround thay problem)
Questions? Bug reports?
Pros:
You may have avatar and creature with same name!
Schemes won't get in random decks for sure inless you've used that special store to get them.
Cons:
Extra efforts when looking for a card of unknown type (hope i wrote enough code to workaround thay problem)
Questions? Bug reports?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: card db split in two
by friarsol » 16 Feb 2013, 01:02
According to Oracle, no cards have the same name. "Birds of Paradise" is a creature. "Birds of Paradise Avatar" is an Avatar.
As far as the split DB, I think that should be fine. Generally when you are looking for special cards, you only need those special cards.
As far as the split DB, I think that should be fine. Generally when you are looking for special cards, you only need those special cards.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: card db split in two
by Max mtg » 16 Feb 2013, 07:07
Good to know that it's now our workaround, but it's global.friarsol wrote:According to Oracle, no cards have the same name. "Birds of Paradise" is a creature. "Birds of Paradise Avatar" is an Avatar.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 75 guests