mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
feat(network): add MessageSerializer for message serialization/deserialization
- Implemented `MessageSerializer` class to handle JSON serialization and deserialization of game messages and payloads. - Added `MessageSerializer.cpp` and `MessageSerializer.h` to `CMakeLists.txt`. - Linked `nlohmann_json` library to the project.
This commit is contained in:
@@ -4,6 +4,7 @@ project(uno-game)
|
||||
set(CMAKE_CXX_STANDARD 26)
|
||||
|
||||
find_package(ftxui CONFIG REQUIRED)
|
||||
find_package(nlohmann_json REQUIRED)
|
||||
|
||||
add_library(uno-game-lib
|
||||
src/game/Card.cpp
|
||||
@@ -12,15 +13,19 @@ add_library(uno-game-lib
|
||||
src/game/GameState.cpp
|
||||
src/common/Utils.cpp
|
||||
src/network/Message.cpp
|
||||
src/network/MessageSerializer.cpp
|
||||
)
|
||||
target_link_libraries(uno-game-lib
|
||||
PRIVATE ftxui::screen
|
||||
PRIVATE ftxui::dom
|
||||
PRIVATE ftxui::component
|
||||
)
|
||||
target_link_libraries(uno-game-lib
|
||||
PRIVATE nlohmann_json::nlohmann_json
|
||||
)
|
||||
|
||||
add_executable(uno-game src/main.cpp)
|
||||
target_link_libraries(uno-game
|
||||
PRIVATE uno-game-lib)
|
||||
target_link_libraries(uno-game
|
||||
PRIVATE ftxui::screen
|
||||
PRIVATE ftxui::dom
|
||||
PRIVATE ftxui::component
|
||||
)
|
||||
|
||||
add_subdirectory(test)
|
||||
Reference in New Issue
Block a user