Skip to main content

This is a RPG resources management toolkit that allows you to create and manage your own RPG game.

架構

1. GameObject

  • 描述:最基本的遊戲物件類別,代表遊戲中的角色、物品等。
  • 屬性:
    • id:物件唯一標識符
    • type:物件類型(如角色、物品)
    • attributes:物件屬性字典
    • equipment:裝備物品字典

2. GameWorld

  • 描述:代表整個遊戲世界的狀態。
  • 功能:
    • 管理多個 GameObject 實例
    • 管理遊戲規則
    • 提供添加、獲取、更新和刪除遊戲物件的方法

3. GameManager

  • 描述:管理單個遊戲實例的核心邏輯。
  • 功能:
    • 使用 GameWorld 維護遊戲狀態
    • 通過 GameRepository 保存和載入遊戲狀態
    • 提供高級操作:
      • 創建角色和物品
      • 設置物件屬性
      • 裝備物品

4. GameRepository(抽象類別)

  • 描述:定義遊戲狀態持久化的介面。
  • 功能:
    • 保存遊戲狀態
    • 載入遊戲狀態
    • 刪除遊戲狀態

5. GameSessionManager

  • 描述:管理多個遊戲會話。
  • 功能:
    • 創建新遊戲
    • 獲取現有遊戲
    • 結束遊戲會話
    • 刪除遊戲數據

具體實現

MemoryGameRepository

  • 描述:GameRepository 的記憶體實現。
  • 功能:
    • 在記憶體中存儲和檢索遊戲數據

類別關係

  1. GameObject ⇒ GameWorld

    • GameWorld 管理多個 GameObject 實例
  2. GameWorld ⇒ GameManager

    • GameManager 使用 GameWorld 來維護遊戲狀態
  3. GameManager ⇒ GameRepository

    • GameManager 通過 GameRepository 保存和載入遊戲狀態
  4. GameSessionManager ⇒ GameManager

    • GameSessionManager 創建和管理多個 GameManager 實例
  5. GameSessionManager ⇒ GameRepository

    • GameSessionManager 使用 GameRepository 來初始化 GameManager

職責劃分

  1. 數據層:GameRepository

    • 負責遊戲數據的持久化操作
  2. 邏輯層:GameManager

    • 處理單個遊戲實例的邏輯
  3. 應用層:GameSessionManager

    • 管理遊戲會話,協調多個遊戲實例
  4. 模型層:GameObject 和 GameWorld

    • 定義遊戲的基本結構和狀態

Todo

  • 也需要幫 GameManager 加一個 service 層,如果遊戲邏輯變得複雜,可以考慮在 GameWorld 和 GameInterface 之間引入 Service 層,這一層可以處理更具體的領域邏輯,如戰鬥系統、庫存管理等

Metadata

Release files for game-realm-keeper 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for game-realm-keeper 0.4.0
File Size Uploaded Provenance
game_realm_keeper-0.4.0.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for game-realm-keeper 0.4.0
File Interpreter ABI Platform
game_realm_keeper-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / game_realm_keeper-0.4.0.tar.gz

Download URL game_realm_keeper-0.4.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1c40390326c0a3dfb781283a1c1738816f4484871031502a46797e667a67f59f
BLAKE2b-256 checksum
How to use checksums
072b67a034c4adec812106596e6a0baf40e8e859d0b7a9c0765fb40eca63895c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / game_realm_keeper-0.4.0-py3-none-any.whl

Download URL game_realm_keeper-0.4.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dee952ce186f9566811ccd2a242489786d9409cd7c6378f355727e230748cbf
BLAKE2b-256 checksum
How to use checksums
8094d2fbb650f9e0e53ad310bdd8f80a63d4c70afe97be2201b02043070b9af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Security for game-realm-keeper 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page