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

Send results #27

Merged
merged 2 commits into from
Mar 30, 2022
Merged

Send results #27

merged 2 commits into from
Mar 30, 2022

Conversation

mrboisvert
Copy link
Collaborator

Added a results message type.

Server sends results to each client after the game ends. Each client receives the survival times of each player and a boolean to tell them if they won or lost.

Clients hide the game and show the results after receiving a results message.

I used the player's class names to identify the agents in the results screen. The results don't show a survival time for agent's that lasted the entire game. The results screen also indicates if the game ended in a tie. I can definitely change how the results are displayed if anyone has feedback.

I didn't add any unit tests for this. I think end to end testing is more applicable here. You can submit this code for the first agent to test the results screen:

class MyAgent(Agent):
"""Enter your code here ..."""
x = 20
def run(self):
self.attack_ranged(0)

@mayshukla mayshukla merged commit 818b610 into main Mar 30, 2022
@mrboisvert mrboisvert deleted the send_results branch March 30, 2022 23:24
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