# CelestialBeing_CommonCodebase **Repository Path**: cbdevs/CelestialBeing_CommonCodebase ## Basic Information - **Project Name**: CelestialBeing_CommonCodebase - **Description**: CB开发的通用仓库,可用于编译前后端公用的静态链接库。 - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-27 - **Last Updated**: 2024-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CB通用代码仓库 本仓库包含CB前后端共用的代码、头文件、工具以及编译脚本。 ### 环境和技术 * 构建工具:CMake * 工具链:MSVC v143 / g++-12 / Clang (有待支持) * 平台:Windows / Linux / MacOS(有待支持) * C++语言标准:C++20 * 包管理器:vcpkg ### 第三方依赖 使用`vcpkg`安装以下依赖以进行编译。 * [jsoncpp](https://github.com/open-source-parsers/jsoncpp) * [gtest](https://github.com/google/googletest) ### 编码规范 遵循[Google编码规范](https://google.github.io/styleguide/cppguide.html)。 额外要求: * 模板类使用`T`作为类型参数名,模版参数使用CamelCase。 * 常量放在`C`(Constants)命名空间下,命名方式为`kCamelCase`。 * 枚举类的后缀为`Type`或其它东西。 * 概念(Concept)的前缀为`C`。 ### 项目结构 * `common`:前后端共用的、可以被编译为静态库各自链接的代码。 * `common/common`:顶层全局公用头文件,包含命名空间定义、基础的常量定义等。 * `common/utility`:基础的通用工具库,包含一些超类声明、通用助手函数、概念、存档、序列化、rpc实现等。 * `common/state`:CB状态相关工具库,包括状态定义、状态缓存、监听、修改序列化等。 * `common/message`:前后端交互消息数据结构的定义、解析工具库。 * `common/pcg`:PCG共用工具库。 * `common/selector`:目标选取器定义和实现库。 * `common/thirdparty`:公用第三方库CMake文件。 * `tools`:各类内容开发用工具的实现。 * `tools/pcg_editor`:PCG规则编辑器。 * `tools/gameevent_editor`:游戏事件编辑器。