commit da095081108f37c7f871b426a624caec793cf15b Author: josh Date: Thu Sep 19 12:22:57 2024 -0400 Initial Project Structure diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9bf0c92 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.18..3.29) +project(ReCaveGame + VERSION 1.0 + LANGUAGES CXX) + + +if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) + message(FATAL_ERROR "In-source builds are not allowed") +endif() + +set(CMAKE_CXX_STANDARD 20) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +include(cmake/CPM.cmake) + +CPMAddPackage( + NAME J3ML + URL https://git.redacted.cc/josh/j3ml/archive/Release-3.1.zip +) + +CPMAddPackage( + NAME JGL + URL https://git.redacted.cc/josh/JGL/archive/Prerelease-33.zip +) + +CPMAddPackage( + NAME JUI + URL https://git.redacted.cc/josh/ReJUI/archive/Prerelease-2.zip +) + + +add_subdirectory(Core) +add_subdirectory(Server) +add_subdirectory(Client) + +add_subdirectory(ClientApp) +add_subdirectory(ServerApp) \ No newline at end of file diff --git a/Client/CMakeLists.txt b/Client/CMakeLists.txt new file mode 100644 index 0000000..5adb32f --- /dev/null +++ b/Client/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.18..3.29) + +file(GLOB_RECURSE CaveClient_HEADERS "include/*.hpp") +file(GLOB_RECURSE CaveClient_SRC "src/*.cpp") + +if (UNIX) + add_library(CaveClient SHARED ${CaveClient_SRC}) +endif() + +if (WIN32) + add_library(CaveClient SHARED ${CaveClient_SRC}) +endif() + +target_include_directories(CaveClient PUBLIC ${CaveCore_SOURCE_DIR}/include) + +target_include_directories(CaveClient PUBLIC "include") + + +set_target_properties(CaveClient PROPERTIES LINKER_LANGUAGE CXX) + +target_link_libraries(CaveClient PUBLIC CaveCore) + + diff --git a/Client/include/Client/temp.hpp b/Client/include/Client/temp.hpp new file mode 100644 index 0000000..7a0359f --- /dev/null +++ b/Client/include/Client/temp.hpp @@ -0,0 +1,3 @@ +#pragma once + +#include \ No newline at end of file diff --git a/Client/src/Client/temp.cpp b/Client/src/Client/temp.cpp new file mode 100644 index 0000000..9d3dcae --- /dev/null +++ b/Client/src/Client/temp.cpp @@ -0,0 +1 @@ +#include "Client/temp.hpp" \ No newline at end of file diff --git a/ClientApp/CMakeLists.txt b/ClientApp/CMakeLists.txt new file mode 100644 index 0000000..4bf834a --- /dev/null +++ b/ClientApp/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.18..3.29) + + +add_executable(CaveClientApp main.cpp) \ No newline at end of file diff --git a/ClientApp/main.cpp b/ClientApp/main.cpp new file mode 100644 index 0000000..2b51ea0 --- /dev/null +++ b/ClientApp/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char** argv) +{ + + std::cout << "ReCaveGame Coming Soon" << std::endl; +} \ No newline at end of file diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt new file mode 100644 index 0000000..19a6469 --- /dev/null +++ b/Core/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.18..3.29) + +file(GLOB_RECURSE CaveCore_HEADERS "include/*.hpp") +file(GLOB_RECURSE CaveCore_SRC "src/*.cpp") + +if (UNIX) + add_library(CaveCore SHARED ${CaveCore_SRC}) +endif() + +if (WIN32) + add_library(CaveCore STATIC ${CaveCore_SRC}) +endif() + +target_include_directories(CaveCore PUBLIC "include") + +set_target_properties(CaveCore PROPERTIES LINKER_LANGUAGE CXX) +target_include_directories(CaveCore PUBLIC ${J3ML_SOURCE_DIR}/include) + +target_link_libraries(CaveCore PUBLIC J3ML) \ No newline at end of file diff --git a/Core/include/Core/Chunk.hpp b/Core/include/Core/Chunk.hpp new file mode 100644 index 0000000..bd67884 --- /dev/null +++ b/Core/include/Core/Chunk.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace CaveGame::Core +{ + + + + class Chunk + { + public: + private: + protected: + + }; +} \ No newline at end of file diff --git a/Core/include/Core/World.hpp b/Core/include/Core/World.hpp new file mode 100644 index 0000000..938256c --- /dev/null +++ b/Core/include/Core/World.hpp @@ -0,0 +1,22 @@ +#pragma once + +namespace CaveGame::Core +{ + + class Tile; + class Wall; + + class World + { + public: + protected: + private: + Tile& GetTile(int x, int y); + void SetTile(int x, int y, Tile t); + Wall& GetWall(int x, int y); + void SetWall(int x, int y, Wall w); + + + + }; +} \ No newline at end of file diff --git a/Core/src/Core/Chunk.cpp b/Core/src/Core/Chunk.cpp new file mode 100644 index 0000000..1bd456a --- /dev/null +++ b/Core/src/Core/Chunk.cpp @@ -0,0 +1 @@ +#include \ No newline at end of file diff --git a/Core/src/Core/World.cpp b/Core/src/Core/World.cpp new file mode 100644 index 0000000..f879c70 --- /dev/null +++ b/Core/src/Core/World.cpp @@ -0,0 +1,2 @@ +#include + diff --git a/Server/CMakeLists.txt b/Server/CMakeLists.txt new file mode 100644 index 0000000..8941a90 --- /dev/null +++ b/Server/CMakeLists.txt @@ -0,0 +1 @@ +cmake_minimum_required(VERSION 3.18..3.29) \ No newline at end of file diff --git a/ServerApp/CMakeLists.txt b/ServerApp/CMakeLists.txt new file mode 100644 index 0000000..0ee2195 --- /dev/null +++ b/ServerApp/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.18..3.29) + + +add_executable(CaveServerApp main.cpp) \ No newline at end of file diff --git a/ServerApp/main.cpp b/ServerApp/main.cpp new file mode 100644 index 0000000..e25dd88 --- /dev/null +++ b/ServerApp/main.cpp @@ -0,0 +1,3 @@ +// +// Created by dawsh on 9/19/24. +// diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake new file mode 100644 index 0000000..d866ad7 --- /dev/null +++ b/cmake/CPM.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.38.7) +set(CPM_HASH_SUM "83e5eb71b2bbb8b1f2ad38f1950287a057624e385c238f6087f94cdfc44af9c5") + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) + +include(${CPM_DOWNLOAD_LOCATION}) \ No newline at end of file