diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8e61928 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.14) +project(src) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) + +add_subdirectory(src) +add_subdirectory(tests) + +# Detect and add SFML +find_package(SFML COMPONENTS system window graphics network audio REQUIRED) +if(NOT SFML_FOUND) + message(FATAL_ERROR "SFML could not be found") +endif() + +# Detect and add GTest +find_package(GTest REQUIRED) +if(GTest_FOUND) + enable_testing() +else() + message(FATAL_ERROR "GTest could not be found") +endif() + +# Find PugiXML +find_path(PugiXML_INCLUDE_DIR pugixml.hpp) +if(NOT IS_DIRECTORY ${PugiXML_INCLUDE_DIR}) + message(FATAL_ERROR "PugiXML could not be found") +endif() \ No newline at end of file diff --git a/README.md b/README.md index 4a5b38f..7d4ca64 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ Project Maat is the codename of my C++ course "mini-project" based on the quote This game is aimed to be a puzzle game in which the player sets different laws for the world and the people within it as to control what happens after hitting "play" and achieve the level's goal. I was inspired both by [The Incredible Machine](https://en.wikipedia.org/wiki/The_Incredible_Machine_(video_game)) and its successors and by a much more recent game : [Baba is you](https://en.wikipedia.org/wiki/Baba_Is_You). +## Structure + +![UML Diagram](UML_Class_Diagram.png) + ## TODO - [ ] Level diff --git a/UML_Class_Diagram.png b/UML_Class_Diagram.png new file mode 100644 index 0000000..c9f4d91 Binary files /dev/null and b/UML_Class_Diagram.png differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..df9624a --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.14) +project(src) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) + +add_library(engine Level.cpp Level.h Entity.cpp Entity.h) + +target_link_libraries(engine + sfml-window + sfml-graphics + sfml-system) \ No newline at end of file diff --git a/src/Entity.cpp b/src/Entity.cpp new file mode 100644 index 0000000..2f48d00 --- /dev/null +++ b/src/Entity.cpp @@ -0,0 +1,5 @@ +// +// Created by trotfunky on 06/06/19. +// + +#include "Entity.h" diff --git a/src/Entity.h b/src/Entity.h new file mode 100644 index 0000000..d89911c --- /dev/null +++ b/src/Entity.h @@ -0,0 +1,14 @@ +// +// Created by trotfunky on 06/06/19. +// + +#ifndef SRC_ENTITY_H +#define SRC_ENTITY_H + + +class Entity { + +}; + + +#endif //SRC_ENTITY_H diff --git a/src/Level.cpp b/src/Level.cpp new file mode 100644 index 0000000..a6a22d8 --- /dev/null +++ b/src/Level.cpp @@ -0,0 +1,5 @@ +// +// Created by trotfunky on 06/06/19. +// + +#include "Level.h" diff --git a/src/Level.h b/src/Level.h new file mode 100644 index 0000000..a3f959b --- /dev/null +++ b/src/Level.h @@ -0,0 +1,18 @@ +// +// Created by trotfunky on 06/06/19. +// + +#ifndef SRC_LEVEL_H +#define SRC_LEVEL_H + + +class Level { + Level(); + +private: + int width; + int height; +}; + + +#endif //SRC_LEVEL_H diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..0d53663 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.14) +project(src) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) + +add_executable(gTests gTests.cpp gTests.cpp) + +target_link_libraries(gTests + engine + gtest + pthread) \ No newline at end of file diff --git a/tests/gTests.cpp b/tests/gTests.cpp new file mode 100644 index 0000000..0eccc74 --- /dev/null +++ b/tests/gTests.cpp @@ -0,0 +1,11 @@ +// +// Created by Teo-CD on 06/06/19. +// + +#include + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc,argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file