Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void processInputs() {

#include "asio.hpp" // Third-party

#include "actor-core/actor.hpp" // Local headers
#include <funkyactors/actor.hpp" // Local headers
#include "snake/game_types.hpp"
```

Expand Down
29 changes: 8 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,15 @@ message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS "C++ Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "C++ Standard: C++${CMAKE_CXX_STANDARD}")

# Fetch standalone Asio via FetchContent
message(STATUS "Downloading standalone Asio via FetchContent")
# Fetch funkyactors via FetchContent
include(FetchContent)
message(STATUS "Downloading funkyactors via FetchContent")
FetchContent_Declare(
asio
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-30-2
funkyactors
GIT_REPOSITORY https://github.com/mahush/funkyactors.git
GIT_TAG main
)
FetchContent_MakeAvailable(asio)

# Create an interface library for asio
add_library(asio INTERFACE)
target_include_directories(asio INTERFACE ${asio_SOURCE_DIR}/asio/include)
target_compile_definitions(asio INTERFACE ASIO_STANDALONE ASIO_NO_DEPRECATED)

# Link with pthread on Unix systems
if(UNIX)
find_package(Threads REQUIRED)
target_link_libraries(asio INTERFACE Threads::Threads)
endif()
FetchContent_MakeAvailable(funkyactors)

# Fetch funkypipes via FetchContent
message(STATUS "Downloading funkypipes via FetchContent")
Expand All @@ -60,7 +49,6 @@ add_executable(snake_actors
src/renderer_actor.cpp
src/snake_model.cpp
src/snake_operations.cpp
src/actor-core/timer/asio_timer_core.cpp
src/utility.cpp
src/logger.cpp
)
Expand All @@ -69,7 +57,7 @@ target_include_directories(snake_actors PRIVATE
${PROJECT_SOURCE_DIR}/include
)

target_link_libraries(snake_actors PRIVATE asio funkypipes)
target_link_libraries(snake_actors PRIVATE funkyactors funkypipes)

target_compile_options(snake_actors PRIVATE
-Wall -Wextra -Wpedantic -Werror
Expand Down Expand Up @@ -108,12 +96,11 @@ if(SNAKE_BUILD_TESTS)
src/renderer_actor.cpp
src/snake_model.cpp
src/snake_operations.cpp
src/actor-core/timer/asio_timer_core.cpp
src/utility.cpp
src/logger.cpp
)

target_link_libraries(test_snake PRIVATE gtest_main gmock_main asio funkypipes)
target_link_libraries(test_snake PRIVATE gtest_main gmock_main funkyactors funkypipes)
target_include_directories(test_snake PRIVATE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/tests
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Matti
Copyright (c) 2025 mahush

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ This separation enables testing game logic without I/O while keeping effects exp
```
snake/
├── include/
│ ├── actor-core/ # Generic actor framework
│ │ ├── actor.hpp # CRTP actor base class
│ │ ├── topic.hpp # Pub/sub messaging
│ │ └── timer/ # Timer infrastructure
│ └── snake/ # Game-specific code
│ ├── game_engine_actor.hpp # Core game logic (functional)
│ ├── game_manager.hpp # Lifecycle coordinator (imperative)
Expand All @@ -101,7 +97,9 @@ snake/

- **CMake 3.12+**
- **C++17 compiler** (GCC 11+, Clang 14+)
- **Standalone Asio 1.30.2** (auto-downloaded via FetchContent)
- **Funkyactors** (auto-downloaded via FetchContent from [github.com/mahush/funkyactors](https://github.com/mahush/funkyactors))
- **Funkypipes** (auto-downloaded via FetchContent from [github.com/mahush/funkypipes](https://github.com/mahush/funkypipes))
- **Standalone Asio 1.30.2** (bundled with funkyactors)
- **GoogleTest 1.15.2** (optional, for tests, auto-downloaded)

## Build and Run
Expand All @@ -127,6 +125,10 @@ cmake --build build

See `CLAUDE.md` for detailed architectural documentation and coding conventions.

## Development

This project was developed with the assistance of AI tools (Claude Code) for code generation, refactoring, and documentation.

## License

See LICENSE file.
Loading
Loading