Cockatrice version:
Version cbea432 (2016-03-08)
Currently trice only supports deck pastes in the current format:
4 ..
3 ..
5 ..
SB: 4 ..
SB: 3 ..
We should add support for at least:
4 ..
4 ..
3 ..
4 ..
2 ..
Which is commonly used in online deck tool exports. There may be other formats to support, so feel free to add them there, if you know of any other ways commonly used tools export decks to text.
Related code: https://github.com/Cockatrice/Cockatrice/blob/master/common/decklist.cpp#L509
Actually Cockatrice also supports this format:
4 ..
4 ..
3 ..
Sideboard
4 ..
2 ..
Also supported are c++-style comments:
4 ..
// Creatures
4 ..
3 ..
We could pre-scan the file for empty lines, trim empty lines at begin or end of the file, and if there's one a single empty line in the middle of the card definitions, consider that empty line as the sideboard separator.
Would this ruin the ability for users to type in cards?
No
Would it be possible to also add support for not having a number of copies? Something like allowing "Swamp" to be recognized equivalently to "1 Swamp".
That's reasonable and should be easy
On Fri, Apr 15, 2016, 10:40 PM KarasuGamma [email protected] wrote:
Would it be possible to also add support for not having a number of
copies? Something like allowing "Swamp" to be recognized equivalently to "1
Swamp".—
You are receiving this because you commented.Reply to this email directly or view it on GitHub
https://github.com/Cockatrice/Cockatrice/issues/1883#issuecomment-210721594
BUMP!
We should also document the types we support.
This should be easy to add unit tests for as well.
I'll work on documentation of this
I'd like to take a stab at this over this week / next weekend. Should I use the tests in tests/carddatabase as an example for how tests should be structured?
Also, does anyone have an idea for how to make copy & paste from sites like http://mtgtop8.com or wizards official coverage easier? They include dividers like 15 CREATURES or CREATURE (5) in their markup. Is it worth ignoring lines that match a list of known card types if that line isn't a card type?
We'd have to make sure typo'd cards are still imported, but not super common dividers.
I'd like to take a stab at this over this week / next weekend. Should I use the tests in tests/carddatabase as an example for how tests should be structured?
There's only a few tests in there, so the structure is not really defined yet. Add a new folder with your tests, or feel free to move things as you think they could be better placed.
Also, does anyone have an idea for how to make copy & paste from sites like http://mtgtop8.com or wizards official coverage easier? They include dividers like 15 CREATURES or CREATURE (5) in their markup. Is it worth ignoring lines that match a list of known card types if that line isn't a card type?
You can either use a blacklist as you suggested, or try to skip any card that doesn't match a card that exists in the card db. Of course this second approach would break on typos, Aether, etc..
We'd have to make sure typo'd cards are still imported, but not super common dividers.
You could try to "simplify" the card name: https://github.com/Cockatrice/Cockatrice/blob/master/cockatrice/src/carddatabase.cpp#L285 and see if it works good enough.
I think we should try to make it "smart" as much as possible but err on the side of including too many lines rather than filtering - it's very easy to remove bad cards from the deck but you might not notice that a card was missed.
Don't check the card db when loading - users might be pulling deck lists from spoiled sets where the card list isn't out yet. Also typos, etc
I'm OK with a strict blacklist approach for known non-card lines if they are standard.
I checked the wizards official coverage site that you linked - the download button gives you a text file that should work already, minus the sideboard cards not being clearly marked.
The mtgtop8 site has a .dec export in MWS deck format, which we should totally support if we don't already - but I think we can process .mwDeck already. Worth checking.
I checked the wizards official coverage site that you linked - the download button gives you a text file that should work already, minus the sideboard cards not being clearly marked.
we received a complain about exactly that recently on reddit:
https://www.reddit.com/r/Cockatrice/comments/5vs1ji/get_decks_from_wizardscom_getting_the_throwback/?utm_content=title&utm_medium=hot&utm_source=reddit&utm_name=Cockatrice
Making it not case sensitive would be great
On Feb 28, 2017 3:45 AM, "tooomm" notifications@github.com wrote:
I checked the wizards official coverage site that you linked - the
download button gives you a text file that should work already, minus the
sideboard cards not being clearly marked.we received a complain about exactly that recently on reddit:
https://www.reddit.com/r/Cockatrice/comments/5vs1ji/
get_decks_from_wizardscom_getting_the_throwback/?utm_
content=title&utm_medium=hot&utm_source=reddit&utm_name=Cockatrice—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Cockatrice/Cockatrice/issues/1883#issuecomment-282978287,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGSWNgI7W66xkvoPqp7sEvZGZZk6yzSlks5rg96lgaJpZM4H3jVo
.
Yeah, it should search for names the same way that [[card]] does
On Tue, Feb 28, 2017 at 12:35 PM ashley notifications@github.com wrote:
Making it not case sensitive would be great
On Feb 28, 2017 3:45 AM, "tooomm" notifications@github.com wrote:
I checked the wizards official coverage site that you linked - the
download button gives you a text file that should work already, minus the
sideboard cards not being clearly marked.we received a complain about exactly that recently on reddit:
https://www.reddit.com/r/Cockatrice/comments/5vs1ji/
get_decks_from_wizardscom_getting_the_throwback/?utm_
content=title&utm_medium=hot&utm_source=reddit&utm_name=Cockatrice—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<
https://github.com/Cockatrice/Cockatrice/issues/1883#issuecomment-282978287
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AGSWNgI7W66xkvoPqp7sEvZGZZk6yzSlks5rg96lgaJpZM4H3jVo.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Cockatrice/Cockatrice/issues/1883#issuecomment-283109604,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAA5NP6IYKS1oIzf6Ldl1cj1NtzIhn6rks5rhFragaJpZM4H3jVo
.
Bump @MarkyMarkMcDonald how's it going? Anything worth reporting? If we can help you, let us know
@Daenyth Can you point me to where in the codebase we handle [[card]]? I found ChatView::appendCardTag setting a link of card://, but I'm having trouble finding where the card:// protocol is handled.
The [[card]] parsing code is at https://github.com/Cockatrice/Cockatrice/blob/master/cockatrice/src/chatview/chatview.cpp#L245
As you stated it calls ChatView::appendCardTag() that adds a link with the card:// scheme in the ChatView; the ChatView inherits from QTextBrowser, so is basically a rich text edit widget.
The ChatView::mouseMoveEvent method takes care of checking if the mouse pointer is over a link
and the scheme of the link.
The ChatView::mousePressEvent method opens the detail popups for card and user links.
At the time I'm writing this comment (09-03-2018) this functionality seems to have been added to Cockatrice
You are right, fixed in #2706
Most helpful comment
BUMP!