ajanata / PretendYoureXyzzy

A web clone of the card game Cards Against Humanity.
https://pretendyoure.xyz/zy
BSD 2-Clause "Simplified" License
1.23k stars 397 forks source link

Refactor game options into subobject. #101

Closed uecasm closed 10 years ago

uecasm commented 10 years ago

This replaces the flat list of game options in the AJAX data (and the chain of builder methods required for it) with a JSON subobject. It does complicate parsing a little, but it will make it easier in future to add or modify game options without merge conflicts.

uecasm commented 10 years ago

I've just rebased this pull branch to include your latest changes (in particular #103), so it should apply cleanly again now. (Not sure if a rebase or merge is better for pull request branches, since they count as publicly shared and rebasing messes with history. But this was a reasonably recent one [so it's less likely to break anyone] and the log will look cleaner this way.)

uecasm commented 10 years ago

Looks like there might be a small bug in this related to the default options for new games. Haven't had a chance to track it down yet.

ajanata commented 10 years ago

Looks good. I'll take a closer look in a couple days when I'm at my computer, and see if I can find any weirdness around default options.

uecasm commented 10 years ago

Actually it looks like it's ok after all. The thing that puzzled me was that I remembered the default spectator limit being 0, and new games were coming up with spectator limits of 10 after this change. But it looks like that was changed when you moved everything to the constants in Game.