Game-as-a-Service / Pandemic-Reign-of-Cthulhu

an interactive web game that brings the board game with the same title to digital implementation
GNU Affero General Public License v3.0
1 stars 0 forks source link

model and repository of clean achitecture for creating game #11

Closed metalalive closed 10 months ago

metalalive commented 11 months ago

The issue #10 has been completed.

According to the functions declared in the repository and domain models , we need someone to implement the detail .

teds-lin commented 10 months ago
  • Domain models
    • Game
    • id , identifier could be generated in UUID format ?
  1. in-memory情境我會建議用UUID,具體依照用途,UUID有不同版本可供選擇,可參考此文件 TLDR: 目的單純僅需要隨機選v4 (執行效率考量) 需要用作資料庫索引或時間排序用途選v7 在我們case v4足夠使用了
  2. 之後實作用db的話,我建議直接用db的id()
    • assign_character(), ensure each player selected different investigator, hash table can do this well, or any other option ?

我認為hash table是好選擇

  • Player
    • is it good idea to bind Player instances to specific Game instance ?

我認為ok, 這隱含假設一位玩家同一時間只能進行一場遊戲

  • In-memory repository

    • InMemoryRepository.save() , use hash table to store key (game ID) value (relevant Game instance) pairs ?

感覺ok, 沒有其他更好的想法

metalalive commented 10 months ago

目的單純僅需要隨機選v4 (執行效率考量) 需要用作資料庫索引或時間排序用途選v7 在我們case v4足夠使用了

我之前讀過 RFC 4122 文件 + 相關的 draft released this year, v4 ,v7 兩者都OK, 先用v4也可以

之後實作用db的話,我建議直接用db的id()

之後我將在 GitHub discussion 中開一個討論, 看要使用哪個資料庫 (e.g. MongoDB, PostgreSQL, any other Non-relational database)

Teds 你能處理這個Issue嗎 ? 目前我正在處理另一個 Issue #19 , 修改完 open API 規格後, 我將開始寫 code 加入一些 API endpoints 供玩家在遊戲開始前進行其他設定 (主要是在 Miro page 中記錄的 endpoints)

我的想法是, backend dev 可以同時工作 / 完成一些事情 這你ok嗎 ? 謝謝

teds-lin commented 10 months ago

Teds 你能處理這個Issue嗎 ?

ok, 不過今天比較忙,我明天處理