crhallberg / json-against-humanity

Finally, Cards Against Humanity as plain text and JSON.
https://crhallberg.com/cah/
Other
166 stars 37 forks source link

White/black object parity for JSON #5

Closed teddybradford closed 6 years ago

teddybradford commented 7 years ago

It would be nice to have the structure of the white and black card arrays be the same. i.e., instead of white cards being an array of strings, have it be an array of objects, each with a "text" property, just like the black cards.

This would make using the data much easier as the structure would be consistent between the two types of cards.

crhallberg commented 7 years ago

That makes sense. Is there any other info besides text and pick that we should add to the cards?

crhallberg commented 7 years ago

Would it also make sense to add a format that is just two arrays of all the card with their own data attached? The current format is geared towards a small file size, but that may not be the most useful restraint.

teddybradford commented 7 years ago

What are you thinking the structure would look like?

crhallberg commented 7 years ago
{
  "black": [
    {
      "text":,
      "pick":,
      "symbol":,
      "deck": "deck1"
    },
    // Another 2,703 cards ...
  ],
  "white": [
    {
      "text":,
      "symbol":,
      "deck": "deck2"
    },
    // Another 7,218 cards ...
  ],
  "metadata": {
    "deck1": {
      "name": "Battle Deck 2K17",
      "description": "..."
    },
    "deck2": {/* ... */},
  }
}
teddybradford commented 7 years ago

That looks good to me. You might also consider changing "black" to "prompts" and "white" to "responses" (ref: https://docs.google.com/spreadsheets/d/1lsy7lIwBe-DWOi2PALZPf5DgXHx9MEvKfRw1GaWQkzg/edit#gid=59).

crhallberg commented 7 years ago

I'm only mildly opposed to this, it wouldn't be any more technically difficult, but I feel like the association is really strong.

teddybradford commented 7 years ago

I'm fine with it either way. I only brought it up because this database includes lots of unofficial decks, which technically aren't supposed to use the names "black" and "white" according to CAH.