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

Changes to allow for playing. #20

Merged
merged 7 commits into from Apr 19, 2022
Merged

Changes to allow for playing. #20

merged 7 commits into from Apr 19, 2022

Conversation

Nikolailb
Copy link
Collaborator

Added toString to important classes. Gameplay example in Game.java.

The game currently uses priority and action points, while move order (based on submission) is not tested. Cleaning, commenting, gameController -> serverController return string and some functionallity is not yet done.

There is also a series of minor changes all over to make gameplay executions smoother.

…ed that players can not occupy the same tile. Made action class contain affected coordinates for easier serverController - gameController communication (example in Game.java main, very bottom).
@Nikolailb
Copy link
Collaborator Author

Nikolailb commented Apr 13, 2022

Now verified action order and that collision works. Changed the performTurn function to return a list of actions, changed actions to contain a list of affected tiles. The list of affected tiles have 3 possible values: null if execute has not been called, empty list if no tiles affected or action failed for some reason, list with coordinates if action successfull. Might change null to empty list later, but might be useful to have a way of determening if an action has been executed.

The makes converting results to string easier. E.g. "Movement: [[0, 0]]" can be achieved with String.format("%s: %s", action.getClass().getSimpleName(), action.getAffectedCoordinates())

@Nikolailb Nikolailb marked this pull request as ready for review April 19, 2022 10:08
Copy link
Collaborator

@TheHundini TheHundini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nikolailb Nikolailb merged commit 4238329 into main Apr 19, 2022
@TheHundini TheHundini deleted the feature/backend-gameplay branch April 19, 2022 10:17
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.

None yet

2 participants