-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player State Endpoint/Game Start #34
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
… GameCards to Players Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…th GameCards Co-Authored-By: Patrick Duvall <duvallp208@gmail.com> Co-Authored-By: Chris Davis <davisc1014@gmail.com>
…ayer GameCards, and adds Coppers and Estates to pool of GameCards Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…available for testing/display Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
… in migration and schema Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…#show Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
… #discard methods to serialize Player State Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…ings Co-Authored-By: Patrick Duvall <duvallp208@gmail.com> Co-Authored-By: Chris Davis <davisc1014@gmail.com>
Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…osseses are discarded or not Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…ow convention of Card attributes with no value Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
…follow convention Co-Authored-By: Patrick Duvall <duvallp208@gmail.com>
DavisC0801
approved these changes
Sep 9, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on fully testing the endpoint, and corrections on the factory.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR brings in the endpoint for the Frontend to receive an individual Players current State. A Player State contains the information of their Deck, their collection of GameCards that have not been discarded yet, and their Discard, their collection of GameCards that have been discarded in the course of the game so far. We decided to start with the easy solution of a Player having a Deck at the beginning of a Game.
For the GameCards to be added to a Players deck, the Game the Player is a part of needs to be
start
ed, which begins a process of creating GameCards that are assigned to the Players, and then also creating GameCards that are in the general pool of cards for the Game. This functionality is required, as stubbing a Player GameCards does not directly reflect the beginning Game State.The instance methods of
deck
anddiscard
on a Player model help organize GameCards based on theirdiscarded
status. Thecards
method required a Joins with the Cards table to enable easy testing and rendering of the GameCard objects for the Frontend.GameCards now have default values in the DB for
trashed
anddiscarded
offalse
.The GameCard factory now correctly creates
estates
,duchys
, andprovinces
with aspending_power
ofnil
, instead of 0. This is how the Frontend needs those values to avoid false positives when rendering.Resolves #27 #33
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: