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

Updating the definition of a game to describe whether it is vs an AI #18

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

AlAnoud2003
Copy link

@AlAnoud2003 AlAnoud2003 commented Dec 10, 2024

Issue number

Relevant issue number

Please check the following

  • Do the tests still pass? (see Run the Tests)
  • Is the code formatted properly? (see Linting (Formatting))
  • For New Features:
    • Have tests been added to cover any new features or fixes?
    • Has the documentation been updated accordingly?

Please describe additional details for testing this change

This pull request addresses step 3 “updating the definition of a game to describe whether it is vs an AI” of issue 505: “Implement CuttleBot (vs AI) in the main cuttle repo”. This step ensures that the game creation logic is properly updated based on the new field “isVsAI”.

File modifications:

  1. api/models/Game.js: Added an isVsAI field to the game model
  2. api/controllers/game/create.js: Updated game creation logic to set the isVsAI field
  3. api/hooks/customGameHook/index.js: Updated the createGame and findGame functions
  4. src/stores/game.js: Updated the client-side game creation logic to include the isVsAI field when creating a game.
  5. src/routes/home/components/GameListItem.vue : Added the isVsAI prop into the frontend component and updated the template to display an indicator that the game is against an AI

…ed property called playersTextto generate correct player text, and updated template to use playersText to display the usernames
…to ensure the correct displaying of usernames based on the player count
…o test the rendering of the correct player information
…layers' usernames, and then verifying that the game list item containes the text (the usernames)
…include the isVsAI field when creating a game
…plate to display an indicator that the game is against an AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant