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

JSON Serialization (Load and Save Game) #82

Merged
merged 28 commits into from Mar 3, 2019

Conversation

Projects
None yet
2 participants
@JimmySnails
Copy link
Owner

commented Feb 28, 2019

Added functionality to serialize values from Map class to json and deserialize them back.

So far it's

  • std::string tileID
  • Point isoCoordinates

The Map can now be destroyed and replaced by a new one. either a clean map (which allows new game functionality and paves the way for terrain generation) or one from a savegame.

I've also fixed a bug in isometric coordinate calculation where values could exceed the vector size,

Remaining Tasks:

  • Memory Leak
  • Top tiles are sometimes lowered. check updateNeighbors() funnction in Map

@JimmySnails JimmySnails added the core label Feb 28, 2019

@JimmySnails JimmySnails self-assigned this Feb 28, 2019

@JimmySnails JimmySnails changed the title [WIP] JSON Serialization (Load and Save Game) JSON Serialization (Load and Save Game) Mar 2, 2019

@JimmySnails

This comment has been minimized.

Copy link
Owner Author

commented Mar 2, 2019

Done.
Functionality for other game specific data (like money, date and so on) can be serialized later.
Adding a savegame dialog, different save files and compression should be done in seperate PRs

JimmySnails added some commits Mar 2, 2019

@utilForever
Copy link
Collaborator

left a comment

I commented on a few parts. Please check it. :)

@JimmySnails

This comment has been minimized.

Copy link
Owner Author

commented Mar 3, 2019

This pull request introduces 2 alerts when merging c7daaed into 448d0bd - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
  • 1 for Multiplication result converted to larger type

Comment posted by LGTM.com

JimmySnails added some commits Mar 3, 2019

@JimmySnails

This comment has been minimized.

Copy link
Owner Author

commented Mar 3, 2019

This pull request introduces 2 alerts when merging 2efbf46 into cc58bf3 - view on LGTM.com

new alerts:

  • 1 for Resource not released in destructor
  • 1 for Multiplication result converted to larger type

Comment posted by LGTM.com

@JimmySnails JimmySnails merged commit 35471e6 into master Mar 3, 2019

3 of 7 checks passed

Travis CI - Branch Build Failed
Details
Travis CI - Pull Request Build Failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
LGTM analysis: C/C++ 2 new alerts
Details
LGTM analysis: JavaScript No code changes detected
Details
@utilForever
Copy link
Collaborator

left a comment

Please merge after I approved code review. (build is failed...)

@JimmySnails JimmySnails deleted the saveToJSON branch Mar 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.