Skip to content
Snippets Groups Projects
Commit 22e9389c authored by marie3003's avatar marie3003
Browse files

added example project

parent f724c120
No related branches found
No related tags found
No related merge requests found
.DS_Store 0 → 100644
File added
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
Lama
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BackendCodeEditorMiscSettings">
<option name="/Default/RiderDebugger/RiderRestoreDecompile/RestoreDecompileSetting/@EntryValue" value="false" type="bool" />
<option name="/Default/Housekeeping/GlobalSettingsUpgraded/IsUpgraded/@EntryValue" value="true" type="bool" />
<option name="/Default/Housekeeping/FeatureSuggestion/FeatureSuggestionManager/DisabledSuggesters/=SwitchToGoToActionSuggester/@EntryIndexedValue" value="true" type="bool" />
<option name="/Default/Housekeeping/FeatureSuggestion/FeatureSuggestionManager/DisabledSuggesters/=SwitchToGoToActionSuggester/@EntryIndexRemoved" />
<option name="/Default/Environment/Hierarchy/GeneratedFilesCacheKey/Timestamp/@EntryValue" value="3" type="long" />
</component>
<component name="CMakePythonSetting">
<option name="pythonIntegrationState" value="YES" />
</component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/wizard.iml" filepath="$PROJECT_DIR$/.idea/wizard.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />
\ No newline at end of file
cmake_minimum_required(VERSION 3.15)
project(Lama) # your project name
set(CMAKE_CXX_STANDARD 20)
include_directories(sockpp/include)
find_package(wxWidgets COMPONENTS core base net REQUIRED)
include(${wxWidgets_USE_FILE})
# define a variable CLIENT_SOURCE_FILES that contains the paths to all source files required to compile the client executable
set(CLIENT_SOURCE_FILES
src/client/main.cpp
src/client/app/Lama.cpp src/client/app/Lama.h
src/client/GameController.cpp src/client/GameController.h
# UI
src/client/windows/GameWindow.cpp src/client/windows/GameWindow.h
src/client/uiElements/ImagePanel.cpp src/client/uiElements/ImagePanel.h
src/client/panels/ConnectionPanel.cpp src/client/panels/ConnectionPanel.h
src/client/panels/MainGamePanel.cpp src/client/panels/MainGamePanel.h
src/client/uiElements/InputField.cpp src/client/uiElements/InputField.h
src/client/uiElements/ImagePanel.cpp src/client/uiElements/ImagePanel.h
# network
src/client/network/ClientNetworkManager.cpp src/client/network/ClientNetworkManager.h
src/client/network/ResponseListenerThread.cpp src/client/network/ResponseListenerThread.h
# game state
src/common/game_state/cards/card.cpp src/common/game_state/cards/card.h
src/common/game_state/game_state.cpp src/common/game_state/game_state.h
src/common/game_state/player/hand.cpp src/common/game_state/player/hand.h
src/common/game_state/player/player.cpp src/common/game_state/player/player.h
src/common/game_state/cards/draw_pile.cpp src/common/game_state/cards/draw_pile.h
src/common/game_state/cards/discard_pile.cpp src/common/game_state/cards/discard_pile.h
# client requests
src/common/network/requests/client_request.cpp src/common/network/requests/client_request.h
src/common/network/requests/play_card_request.cpp src/common/network/requests/play_card_request.h
src/common/network/requests/draw_card_request.cpp src/common/network/requests/draw_card_request.h
src/common/network/requests/fold_request.cpp src/common/network/requests/fold_request.h
src/common/network/requests/join_game_request.cpp src/common/network/requests/join_game_request.h
src/common/network/requests/start_game_request.cpp src/common/network/requests/start_game_request.h
# server responses
src/common/network/responses/server_response.cpp src/common/network/responses/server_response.h
src/common/network/responses/request_response.cpp src/common/network/responses/request_response.h
src/common/network/responses/full_state_response.cpp src/common/network/responses/full_state_response.h
# serialization
src/common/serialization/serializable.h
src/common/serialization/value_type_helpers.h
src/common/serialization/vector_utils.h
src/common/serialization/serializable_value.h
src/common/serialization/json_utils.h
src/common/serialization/uuid_generator.h
src/common/serialization/unique_serializable.cpp src/common/serialization/unique_serializable.h)
# define a variable SERVER_SOURCE_FILES that contains the paths to all source files required to compile the server executable
set(SERVER_SOURCE_FILES
src/server/main.cpp
src/server/game_instance.cpp src/server/game_instance.h
src/server/game_instance_manager.cpp src/server/game_instance_manager.h
src/server/player_manager.cpp src/server/player_manager.h
src/server/server_network_manager.cpp src/server/server_network_manager.h
# game state
src/common/game_state/cards/card.cpp src/common/game_state/cards/card.h
src/common/game_state/game_state.cpp src/common/game_state/game_state.h
src/common/game_state/player/hand.cpp src/common/game_state/player/hand.h
src/common/game_state/player/player.cpp src/common/game_state/player/player.h
src/common/game_state/cards/draw_pile.cpp src/common/game_state/cards/draw_pile.h
src/common/game_state/cards/discard_pile.cpp src/common/game_state/cards/discard_pile.h
# client requests
src/common/network/requests/client_request.cpp src/common/network/requests/client_request.h
src/common/network/requests/play_card_request.cpp src/common/network/requests/play_card_request.h
src/common/network/requests/draw_card_request.cpp src/common/network/requests/draw_card_request.h
src/common/network/requests/fold_request.cpp src/common/network/requests/fold_request.h
src/common/network/requests/join_game_request.cpp src/common/network/requests/join_game_request.h
src/common/network/requests/start_game_request.cpp src/common/network/requests/start_game_request.h
# server responses
src/common/network/responses/server_response.cpp src/common/network/responses/server_response.h
src/common/network/responses/request_response.cpp src/common/network/responses/request_response.h
src/common/network/responses/full_state_response.cpp src/common/network/responses/full_state_response.h
# serialization
src/common/serialization/serializable.h
src/common/serialization/value_type_helpers.h
src/common/serialization/vector_utils.h
src/common/serialization/serializable_value.h
src/common/serialization/json_utils.h
src/common/serialization/uuid_generator.h
src/common/serialization/unique_serializable.cpp src/common/serialization/unique_serializable.h src/server/request_handler.h src/server/request_handler.cpp)
# set source files for client-executable
add_executable(Lama-client ${CLIENT_SOURCE_FILES})
# set compile directives for client-executable
target_compile_definitions(Lama-client PRIVATE LAMA_CLIENT=1 RAPIDJSON_HAS_STDSTRING=1)
# link with wxWidgets
target_link_libraries(Lama-client ${wxWidgets_LIBRARIES})
# Comment out if you don't want to print network-related messages into the console
target_compile_definitions(Lama-client PRIVATE PRINT_NETWORK_MESSAGES=1)
# set source files for server-executable
add_executable(Lama-server ${SERVER_SOURCE_FILES})
# set compile directives for server-executable
target_compile_definitions(Lama-server PRIVATE LAMA_SERVER=1 RAPIDJSON_HAS_STDSTRING=1)
# Comment out if you don't want to print network-related messages into the console
target_compile_definitions(Lama-server PRIVATE PRINT_NETWORK_MESSAGES=1)
# linking to sockpp
if(WIN32)
message("Detected Win32")
target_link_libraries(Lama-client ${CMAKE_SOURCE_DIR}/sockpp/cmake-build-debug/sockpp-static.lib)
target_link_libraries(Lama-server ${CMAKE_SOURCE_DIR}/sockpp/cmake-build-debug/sockpp-static.lib)
# Necessary to get sockets working under Windows (with MingW)
target_link_libraries(Lama-client wsock32 ws2_32)
else()
message("Not Win32, so probably a Linux") # We assume it's Linux in this case
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(Lama-client ${CMAKE_SOURCE_DIR}/sockpp/cmake-build-debug/libsockpp.so Threads::Threads)
target_link_libraries(Lama-server ${CMAKE_SOURCE_DIR}/sockpp/cmake-build-debug/libsockpp.so Threads::Threads)
endif()
# copy assets (images) to binary directory
file(INSTALL assets DESTINATION ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_FLAGS "--coverage")
# set source files for server-library
add_library(Lama-lib ${SERVER_SOURCE_FILES})
# set compile directives for server-library
target_compile_definitions(Lama-lib PRIVATE LAMA_SERVER=1 RAPIDJSON_HAS_STDSTRING=1)
add_subdirectory(googletest)
add_subdirectory(unit-tests)
\ No newline at end of file
assets/lama_1.png

31.9 KiB

assets/lama_2.png

28.6 KiB

assets/lama_3.png

27.4 KiB

assets/lama_4.png

22.9 KiB

assets/lama_5.png

28.5 KiB

assets/lama_6.png

28.6 KiB

assets/lama_7.png

33.9 KiB

assets/lama_back.png

33.8 KiB

assets/lama_hand_0.png

17.3 KiB

assets/lama_hand_1.png

35 KiB

assets/lama_hand_10.png

61.9 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment