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

Make grid a resource #65

Closed
BenjaTK opened this issue Oct 26, 2023 · 0 comments · Fixed by #67
Closed

Make grid a resource #65

BenjaTK opened this issue Oct 26, 2023 · 0 comments · Fixed by #67
Labels
🛠 breaking A change that could break already existing projects. ✨ enhancement New feature or request
Milestone

Comments

@BenjaTK
Copy link
Owner

BenjaTK commented Oct 26, 2023

I think the grid could be changed to a GaeaGrid resource, instead of just a dictionary. This resource would still have a dictionary, but it would allow for easier adding of features and saving.

The pros:

  • Could add get_value and set_value methods which would allow for doing stuff like Add layers #25, RandomTileInfo #48 or TileInfoPattern #51.
  • As a resource, it can be easily saved and loaded.
  • Grid logic would be separated from generation, which is kinda what we've been doing with stuff like separating generation from rendering, and all that.
  • Could have helper functions such as getting the neighbors of a tile (which already exist in the Generator class, but is a bit of a mess).

The cons:

  • Lot of refactoring
  • Resources can sometimes be a bit wonky
  • Can't think of anything more tbh
@BenjaTK BenjaTK added ✨ enhancement New feature or request 🛠 breaking A change that could break already existing projects. labels Oct 26, 2023
@BenjaTK BenjaTK added this to the v1.0.0 milestone Oct 26, 2023
@BenjaTK BenjaTK changed the title Change grid to be a resource Make grid a resource Oct 26, 2023
@BenjaTK BenjaTK mentioned this issue Oct 26, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 breaking A change that could break already existing projects. ✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant