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

[#11] feature: model and repository of creating game #23

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

teds-lin
Copy link
Collaborator

@teds-lin teds-lin commented Nov 1, 2023

實作以下部份並且新增相關測試案例:

  • Domain models

    • Game
      -add_players()
      • 玩家人數限制為2~4人
      • bind Player instances to specific Game instance
    • id , identifier could be generated in UUID v4 format
    • assign_character(), 僅紀錄目前哪些調查員已被選擇,具體那個玩家選擇那個調查員由Player class紀錄
  • Player

    • 紀錄選擇那個調查員
  • In-memory repository

    • InMemoryRepository.save()
      • Using hash table to store key (game ID) value (relevant Game instance) pairs
      • Provide thread-safe access to the in-memory games dictionary

@teds-lin teds-lin added feature For those who propose to add new feature or modify existing features backend dev For back-end development related to this codebase labels Nov 1, 2023
@teds-lin teds-lin requested a review from metalalive November 1, 2023 15:20
@teds-lin teds-lin self-assigned this Nov 1, 2023
Copy link
Collaborator

@metalalive metalalive left a comment

Choose a reason for hiding this comment

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

Ted thanks for the code, the domain models look good,
I have questions about in-memory repository , and left my review comments at files changed tab, please take a look, thanks

c.c. @wingtkw , If you'd like to learn the code in this PR, please leave comments at here or in GitHub Discussion

backend/app/adapter/repository/in_mem.py Outdated Show resolved Hide resolved
backend/app/adapter/repository/in_mem.py Outdated Show resolved Hide resolved
backend/app/usecase/create_game.py Show resolved Hide resolved
@teds-lin teds-lin requested a review from metalalive November 2, 2023 14:41
Copy link
Collaborator

@metalalive metalalive left a 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, thanks again

@teds-lin teds-lin merged commit 4ab035e into main Nov 2, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dev For back-end development related to this codebase feature For those who propose to add new feature or modify existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants