Skip to content
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

Refactor locations (version 2) #519

Merged
merged 2 commits into from
Oct 7, 2023
Merged

Refactor locations (version 2) #519

merged 2 commits into from
Oct 7, 2023

Conversation

skizzerz
Copy link
Member

@skizzerz skizzerz commented Oct 7, 2023

This is a significantly lighter refactor than #518. To wit,

  • The absent status remains. We move people to the square or their house depending on their absent status at beginning of day, but otherwise location during daytime does not impact ability to vote by itself.
  • Locations are singleton objects based on their name and do not carry any game state in the object itself. All game state is stored in GameState itself.
  • There are no location subclasses; everything is just directly a Location.
  • All access to location data is done via the locations APIs rather than directly modifying the GameState variables. This allows for easier future refactors of how we are storing data.

This is a significantly lighter refactor than #518. To wit,

- The absent status remains. We move people to the square or their house
  depending on their absent status at beginning of day, but otherwise
  location during daytime does not impact ability to vote by itself.
- Locations are singleton objects based on their name and do not carry
  any game state in the object itself. All game state is stored in
  GameState itself.
- There are no location subclasses; everything is just directly a
  Location.
- All access to location data is done via the locations APIs rather than
  directly modifying the GameState variables. This allows for easier
  future refactors of how we are storing data.
@skizzerz skizzerz requested a review from Vgr255 October 7, 2023 03:24
Missed this in my initial passthrough. This PR is now tested though ;)
@Vgr255 Vgr255 merged commit 09dcc08 into master Oct 7, 2023
3 checks passed
@Vgr255 Vgr255 deleted the locations2 branch October 7, 2023 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants