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
Feature/areaRepo #16
Feature/areaRepo #16
Conversation
…toring and retrieving Areas. Also, added example use of AreaCollection in world. Added a Junit test for the AreaCollection class.
Resolves #4 |
Just realized I made a pull request to master; Changed to develop and fixed a merge conflict. |
I'm a bit worried about the added complexity. Maybe we should make Areas a possible way of organizing? What do you think? |
It does add another layer of complexity. The benefit is you can now add locations to areas and when displaying the possible locations to a user; you can find the locations grouped together for easier processing. You created the area "Castle Throne" with a unique ID of 1 and all locations will inserted into "Castle Throne". Now when I display the possible locations I can just find the area and iterate through the locations. |
Yeah, that makes sense. How about making them an optional part of making locations? I can think of a few scenarios where Areas don't make sense (single-area short games, single-room world sections, etc.) |
True. If you feel more comfortable shelving it for now i'm all game for that. It does add a layer of complexity and we could revisit it if we start to find a need for. |
I think we just need to make it optional, add a constructor option without an Area argument. |
Sounds good. I'll make the changes for it to be optional. |
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.
Overall looks good. Just do the thing I talked about upthread, and I don't know if the .idea/ folder needs to stay in, but I'll trust your judgment on that. I made a few comments as well, just change those and it should be good!
src/main/java/xyz/devosmium/games/textadventureengine/locations/AreaCollection.java
Outdated
Show resolved
Hide resolved
src/main/java/xyz/devosmium/games/textadventureengine/locations/AreaCollection.java
Outdated
Show resolved
Hide resolved
src/main/java/xyz/devosmium/games/textadventureengine/menus/MainMenu.java
Outdated
Show resolved
Hide resolved
src/test/java/xyz/devosmium/games/locations/AreaCollectionTest.java
Outdated
Show resolved
Hide resolved
Fixed the changes. |
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.
App.java throws an error (https://scans.gradle.com/s/tgstkxv72ehsm). Looks like you forgot an import in it.
Fixed the error. It was a good catch my local machine ran without throwing the error. |
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.
Looks good to me!
I know we talked about possibly not using an AreaRepo, so take a look and see if it will work. In the world.java I added an example of its use.