This project is read-only.
1
Vote

Restructure and Document SmartPlay

description

The API for SmartPlay needs to be restructure to allow developers to more easily plug in cards. Furthermore, the API needs to be documented to make development easier.

comments

bagdonas wrote Apr 3, 2013 at 4:17 PM

Reading the "Deck Format" I was looking to the way how you split the text file using different characters ':', '>' and numbers.

Example:
:Test Deck 1
This deck is just for testing purposes. It is not actually a good deck
4-Wall of Omens
20-Island
I just want to share how here in my job they format some text files.

They use numbers as codes for each case.

3 means the begining of the document (if it came whithout it, there is a bug for sure)
0 is used for registers
2 is for the last line of the document.

Then with the deck you could use numbers for each case too.

Example:

0 - Comments
1 - Begin
2 - End
3 - plains
4 - islands
5 - card
etc...

That's it :D

technaj wrote Apr 3, 2013 at 8:30 PM

Not sure if this is relevant to this issue :P, it refers to how the program handles the pre-programmed cards after they have been read in from the deck file. (For example in smart play when playing Wall of Omens, the program automatically draws a card for you).

Anyways,
A couple advantages I see with your suggestion -
Clearer Code:
-Simpler to have an Enum specifying the case in the parsing.
-Easier to add a line type

However, I don't think this is worth addressing until either we add a line type for encoding the deck (maybe down the line it could be cool to add a way to make your own card, specifying a name, special abilities, and other stats). I'll keep it in mind though.