diff --git a/.idea/PolymorphEngine.iml b/.idea/PolymorphEngine.iml new file mode 100644 index 00000000..f08604bb --- /dev/null +++ b/.idea/PolymorphEngine.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..5bcb98fd --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 79b3c948..403c040a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..158ab287 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index aabcd35e..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1643982815487 - - - - - - - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 73299b48..727c6fd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,20 +4,40 @@ project(Engine) set(CMAKE_CXX_STANDARD 20) include_directories( + lib/myxmlpp/include include - include/Engine - include/Engine/component - include/Engine/entity - include/Engine/config - include/Engine/scene - include/Engine/Utilities - include/Engine/Utilities/Types + include/Core + include/Exceptions + include/Core/component + include/Core/component/builtins + include/Core/component/builtins/drawables + include/Core/component/builtins/colliders + include/Core/entity + include/Config + include/Core/scene + include/Core/settings + include/Utilities + include/Utilities/types ) +add_subdirectory(lib/myxmlpp) +set_target_properties(myxmlpp PROPERTIES POSITION_INDEPENDENT_CODE ON) + file(GLOB_RECURSE SRC src/*.cpp) file(GLOB_RECURSE ICL include/*.hpp) +file(GLOB_RECURSE ICL_HEADERS include/Polymorph/*.hpp) -add_executable(Engine +add_library(PolymorphEngine ${SRC} ${ICL} - ) + ${ICL_HEADERS} +) +target_link_libraries(PolymorphEngine myxmlpp dl) +target_link_options(PolymorphEngine PUBLIC "-Wl,--no-undefined") +set_target_properties(PolymorphEngine PROPERTIES POSITION_INDEPENDENT_CODE ON) + +add_executable(TestMain EXCLUDE_FROM_ALL + SampleProject/test_main.cpp +) + +target_link_libraries(TestMain PolymorphEngine) \ No newline at end of file diff --git a/Doxyfile b/Doxyfile index 596b5d58..cf0707fa 100644 --- a/Doxyfile +++ b/Doxyfile @@ -871,7 +871,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = . +INPUT = src include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -960,7 +960,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = docs clion-utilities +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/SampleProject/test_main.cpp b/SampleProject/test_main.cpp new file mode 100644 index 00000000..ebc0cc47 --- /dev/null +++ b/SampleProject/test_main.cpp @@ -0,0 +1,37 @@ +/* +** EPITECH PROJECT, 2020 +** test_main.cpp +** File description: +** test_main.cpp +*/ + +#include +#include + +int main() +{ + std::string path = "./build"; + std::string name = "Test"; + + + try + { + Polymorph::Engine e = Polymorph::Engine(path, name); + e.loadGraphicalAPI("./lib/libarcade_sfml.so"); + e.loadScriptingAPI(path + "/" +name + ".so"); + e.loadEngine(); + e.run(); + e; + } + catch (ConfigurationException &e) + { + e.what(); + return 84; + } + catch (std::exception& e) + { + std::cerr << e.what() << std::endl; + return 84; + } + return 0; +} \ No newline at end of file diff --git a/include/Engine/component/factory/ComponentInitializer.hpp b/include/ComponentsFactory/AComponentInitializer.hpp similarity index 50% rename from include/Engine/component/factory/ComponentInitializer.hpp rename to include/ComponentsFactory/AComponentInitializer.hpp index 4124cd57..4e067386 100644 --- a/include/Engine/component/factory/ComponentInitializer.hpp +++ b/include/ComponentsFactory/AComponentInitializer.hpp @@ -5,20 +5,41 @@ ** header for IComponentInitializer.c */ -#ifndef ENGINE_COMPONENTINITIALIZER_HPP -#define ENGINE_COMPONENTINITIALIZER_HPP +#ifndef ENGINE_ACOMPONENTINITIALIZER_HPP +#define ENGINE_ACOMPONENTINITIALIZER_HPP + +#include +#include -#include "config/XmlComponent.hpp" -#include "config/XmlEntityRef.hpp" -#include "Component.hpp" namespace Polymorph { + namespace Config { + class XmlComponent; + } + class Entity; + + class Component; class AComponentInitializer { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + AComponentInitializer(std::string type, Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + + protected: + std::shared_ptr component; + Config::XmlComponent &data; + std::string type; + public: - AComponentInitializer(const std::string &type, Config::XmlComponent &data, Entity &entity) - : data(data), type(type){}; virtual std::shared_ptr &build() = 0; + virtual void reference() = 0; std::shared_ptr &get() @@ -37,9 +58,10 @@ namespace Polymorph } protected: - std::shared_ptr component; - Config::XmlComponent &data; - std::string type; + void _init(); +///////////////////////////--------------------------/////////////////////////// }; + + } -#endif //ENGINE_COMPONENTINITIALIZER_HPP +#endif //ENGINE_ACOMPONENTINITIALIZER_HPP diff --git a/include/ComponentsFactory/ComponentFactory.hpp b/include/ComponentsFactory/ComponentFactory.hpp new file mode 100644 index 00000000..05991932 --- /dev/null +++ b/include/ComponentsFactory/ComponentFactory.hpp @@ -0,0 +1,66 @@ +/* +** EPITECH PROJECT, 2020 +** ComponentFactory.hpp.h +** File description: +** header for ComponentFactory.c +*/ + +// @TEMPLATE: +// {"*", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new *Initializer(data, entity));}}, + +#ifndef ENGINE_COMPONENTFACTORY_HPP +#define ENGINE_COMPONENTFACTORY_HPP + +#include +#include + +#include +#include +#include + +// @COMPONENTS: (add components include here) +#include "ComponentsFactory/initializers/TransformInitializer.hpp" +#include "ComponentsFactory/initializers/SpriteRendererInitializer.hpp" +#include "ComponentsFactory/initializers/TextRendererInitializer.hpp" +#include "ComponentsFactory/initializers/ColliderCircle2dInitializer.hpp" +#include "ComponentsFactory/initializers/ColliderRect2dInitializer.hpp" + +namespace Polymorph +{ + class AComponentInitializer; + class ComponentFactory + { + public: + using Initializer = std::shared_ptr; +///////////////////////////////// Constructors ///////////////////////////////// + + public: + static Initializer create(std::string &type, Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + + private: + static const inline std::map> + _buildables = + { + // @INITIALIZERS: (add Component Initializers here) + // @TRANSFORM: + { + {"Transform", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new TransformInitializer(data, entity));}}, + {"ColliderCircle2d", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new ColliderCircle2dInitializer(data, entity));}}, + {"ColliderRect2d", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new ColliderRect2dInitializer(data, entity));}}, + {"SpriteRenderer", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new SpriteRendererInitializer(data, entity));}}, + {"TextRenderer", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new TextRendererInitializer(data, entity));}}, + }, + }; +///////////////////////////--------------------------/////////////////////////// + + }; +} + +#endif //ENGINE_COMPONENTFACTORY_HPP diff --git a/include/ComponentsFactory/initializers/ColliderCircle2dInitializer.hpp b/include/ComponentsFactory/initializers/ColliderCircle2dInitializer.hpp new file mode 100644 index 00000000..3d18bb83 --- /dev/null +++ b/include/ComponentsFactory/initializers/ColliderCircle2dInitializer.hpp @@ -0,0 +1,39 @@ +/* +** EPITECH PROJECT, 2020 +** ColliderCircle2dInitializer.hpp +** File description: +** header for ColliderCircle2dInitializer.c +*/ + +#ifndef ENGINE_COLLIDERCIRCLE2DINITIALIZER_HPP +#define ENGINE_COLLIDERCIRCLE2DINITIALIZER_HPP + +#include "ComponentsFactory/AComponentInitializer.hpp" + +namespace Polymorph +{ + class ColliderCircle2dInitializer : public AComponentInitializer + { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + ColliderCircle2dInitializer(Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + std::shared_ptr &build() final; + + void reference() final {}; + +///////////////////////////--------------------------/////////////////////////// + + }; +} + + +#endif //ENGINE_COLLIDERCIRCLE2DINITIALIZER_HPP diff --git a/include/ComponentsFactory/initializers/ColliderRect2dInitializer.hpp b/include/ComponentsFactory/initializers/ColliderRect2dInitializer.hpp new file mode 100644 index 00000000..f9a1a637 --- /dev/null +++ b/include/ComponentsFactory/initializers/ColliderRect2dInitializer.hpp @@ -0,0 +1,38 @@ +/* +** EPITECH PROJECT, 2020 +** ColliderRect2dInitializer.hpp +** File description: +** header for ColliderRect2dInitializer.c +*/ + +#ifndef ENGINE_COLLIDERRECT2DINITIALIZER_HPP +#define ENGINE_COLLIDERRECT2DINITIALIZER_HPP + +#include "ComponentsFactory/AComponentInitializer.hpp" + +namespace Polymorph +{ + class ColliderRect2dInitializer : public AComponentInitializer + { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + ColliderRect2dInitializer(Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + std::shared_ptr &build() final; + + void reference() final {}; + +///////////////////////////--------------------------/////////////////////////// + + }; +} + +#endif //ENGINE_COLLIDERRECT2DINITIALIZER_HPP diff --git a/include/ComponentsFactory/initializers/SpriteRendererInitializer.hpp b/include/ComponentsFactory/initializers/SpriteRendererInitializer.hpp new file mode 100644 index 00000000..d8b2fd84 --- /dev/null +++ b/include/ComponentsFactory/initializers/SpriteRendererInitializer.hpp @@ -0,0 +1,39 @@ +/* +** EPITECH PROJECT, 2020 +** SpriteRendererInitializer.hpp +** File description: +** header for SpriteRendererInitializer.c +*/ + +#ifndef ENGINE_SPRITERENDERERINITIALIZER_HPP +#define ENGINE_SPRITERENDERERINITIALIZER_HPP + +#include "ComponentsFactory/AComponentInitializer.hpp" + +namespace Polymorph +{ + class SpriteRendererInitializer : public AComponentInitializer + { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + SpriteRendererInitializer(Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + std::shared_ptr &build() final; + + void reference() final; + +///////////////////////////--------------------------/////////////////////////// + }; + + +} + +#endif //ENGINE_SPRITERENDERERINITIALIZER_HPP diff --git a/include/ComponentsFactory/initializers/TextRendererInitializer.hpp b/include/ComponentsFactory/initializers/TextRendererInitializer.hpp new file mode 100644 index 00000000..9514b01a --- /dev/null +++ b/include/ComponentsFactory/initializers/TextRendererInitializer.hpp @@ -0,0 +1,38 @@ +/* +** EPITECH PROJECT, 2020 +** TextRendererInitalizer.hpp +** File description: +** header for TextRendererInitalizer.c +*/ + +#ifndef ENGINE_TEXTRENDERERINITIALIZER_HPP +#define ENGINE_TEXTRENDERERINITIALIZER_HPP + +#include "ComponentsFactory/AComponentInitializer.hpp" + +namespace Polymorph +{ + class TextRendererInitializer : public AComponentInitializer + { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + TextRendererInitializer(Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + std::shared_ptr &build() final; + + void reference() final; +///////////////////////////--------------------------/////////////////////////// + }; + + +} + +#endif //ENGINE_TEXTRENDERERINITIALIZER_HPP diff --git a/include/ComponentsFactory/initializers/TransformInitializer.hpp b/include/ComponentsFactory/initializers/TransformInitializer.hpp new file mode 100644 index 00000000..345fe006 --- /dev/null +++ b/include/ComponentsFactory/initializers/TransformInitializer.hpp @@ -0,0 +1,36 @@ +/* +** EPITECH PROJECT, 2020 +** TransformInitializer.hpp.h +** File description: +** header for TransformInitializer.c +*/ + +#ifndef ENGINE_TRANSFORMINITIALIZER_HPP +#define ENGINE_TRANSFORMINITIALIZER_HPP + +#include "ComponentsFactory/AComponentInitializer.hpp" + +namespace Polymorph +{ + class TransformInitializer : public AComponentInitializer + { +///////////////////////////////// Constructors ///////////////////////////////// + + public: + TransformInitializer(Config::XmlComponent &data, Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + std::shared_ptr &build() final; + + void reference() final; +///////////////////////////--------------------------/////////////////////////// + }; +} + +#endif //ENGINE_TRANSFORMINITIALIZER_HPP diff --git a/include/Config/XmlComponent.hpp b/include/Config/XmlComponent.hpp new file mode 100644 index 00000000..aa2f0bb9 --- /dev/null +++ b/include/Config/XmlComponent.hpp @@ -0,0 +1,447 @@ +/* +** EPITECH PROJECT, 2020 +** XmlComponent.hpp.h +** File description: +** header for XmlComponent.c +*/ + +#ifndef ENGINE_XMLCOMPONENT_HPP +#define ENGINE_XMLCOMPONENT_HPP + +#include +#include +#include +#include +#include +#include "safe_ptr.hpp" + +#include "SceneManager.hpp" +#include "Log/Logger.hpp" +#include "Entity.hpp" +#include "ConfigurationException.hpp" + +namespace Polymorph +{ + class Scene; + class Rect; + class Vector2; + class Vector3; + class Entity; + class SpriteModule; + class TextModule; + + namespace Config + { + using XmlNode = myxmlpp::Node; + + /** + * @class XmlComponent The class that interfaces a Component Xml Node + * and the actual Component + * inside the engine. + */ + class XmlComponent + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + explicit XmlComponent(const std::shared_ptr &node = nullptr); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + const static inline std::shared_ptr Empty = std::make_shared(nullptr); + private: + /** + * @property node which contains all data needed to load the binded component. + */ + std::shared_ptr node = nullptr; + + /** + * @property the type of the component + */ + std::string type = "Empty"; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + + /** + * @details Looks for the initial state of the component in the config + * @return the component enable state + */ + bool isEnabled(); + + /** + * @details Looks for the component type in the component's config file + * @return The type of the component + */ + std::string getType(); + + + /** + * @defgroup SetPropertySimple + * @details A set of functions that takes a property as parameter and set its value with the configuration file + * @param propertyName the name of the property in config + * @param toSet the property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + + /** + * @defgroup SetPropertyList + * @details A set of functions that takes a property List as parameter and adds elements in it based on the configuration file + * @param propertyName the name of the property in config + * @param toSet the List property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, GameObject &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, Vector3 &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, Vector2 &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, Rect &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, int &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, float &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, bool &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, std::string &toSet, Logger::severity level = Logger::DEBUG); + + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, safe_ptr &toSet, Logger::severity level = Logger::DEBUG); + + /** + * @ingroup SetPropertySimple + */ + void setProperty(const std::string& propertyName, safe_ptr &toSet, Logger::severity level = Logger::DEBUG); + + + /** + * @ingroup SetPropertyList + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(std::string propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(std::string propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + + + /** + * @details , doesn't touch it if property is not found + * @tparam T the type of the property to set, it's type can be an unknown type class as long as its constructor can take an xml node to construct the object + * @param propertyName the name of the property in config + * @param toSet the property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + void setProperty(std::string propertyName, T &toSet, Logger::severity level = Logger::DEBUG) + { + std::shared_ptr property = _findProperty(std::move(propertyName), level); + + if (property == nullptr) + return; + + toSet = T(property); + }; + + /** + * @details sets a property List by its name, doesn't touch it if property is not found + * @tparam T the type of the properties Elements of the List to set, it's type can be an unknown type class as long as its constructor can take an xml node to construct the object + * @param propertyName the name of the property in config + * @param toSet the property List to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG) + { + auto propNode = _findProperty(propertyName, level); + auto i = 0; + + if (propNode == nullptr) + return; + + for (auto &element : *propNode) { + try { + toSet.emplace_back(element); + } catch (...) { + Logger::log("Property List of Templates named '" + + propertyName + "': Element nb "+std::to_string(i)+" has no value", + level); + } + ++i; + } + }; + + /** + * @details sets Component Reference by its property name, doesn't touch it if property is not found + * @tparam T the type of the Component to set + * @param propertyName the name of the property in config + * @param toSet the Component Reference to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + void setProperty(const std::string& propertyName, safe_ptr &toSet, Logger::severity level = Logger::DEBUG) + { + auto refProp = _findProperty(propertyName, level); + + if (refProp == nullptr) + return; + + try { + auto id = refProp->findAttribute("id")->getValue(); + auto gameObject = SceneManager::findById(id); + auto comp = gameObject->getComponent(); + + if (!comp) + throw; + toSet = comp; + } catch (...) { + if (level != Logger::MAJOR) + Logger::log("In component '"+node->findAttribute("type")->getValue()+"': ComponentRef named '" + propertyName + + "': has missing value or not found", level); + else + throw ConfigurationException("In component '"+node->findAttribute("type")->getValue()+"': ComponentRef named '" + propertyName + + "': has missing value or not found", Logger::MAJOR); + } + } + + /** + * @details sets a List of Component Reference by its property name, doesn't touch it if property is not found + * @tparam T the type of the Components in the List to set + * @param propertyName the name of the property List in config + * @param toSet the Component Reference List to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + void setProperty(const std::string& propertyName, std::vector> &toSet, Logger::severity level = Logger::DEBUG) + { + auto refProp = _findProperty(propertyName, level); + auto i = 0; + + if (refProp == nullptr) + return; + + for (auto &elem : *refProp) { + try { + auto id = refProp->findAttribute("id")->getValue(); + auto gameObject = SceneManager::findById(id); + auto comp = gameObject->getComponent(); + + if (!comp) + throw; + toSet.push_back(comp); + } catch (...) { + Logger::log("Property Component ref nb :" + + std::to_string(i) + + ", in list named '" + propertyName + + "': has no value", Logger::DEBUG); + } + ++i; + } + }; + + /** + * @details sets a List of GameObject References by its property name, doesn't touch it if property is not found + * @param propertyName the name of the property List in config + * @param toSet the GameObject Reference List to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + void setProperty(const std::string& propertyName, std::vector &toSet, Logger::severity level = Logger::DEBUG); + + + + +//////////////////////------------STATICS-----------------///////////////////////// + + /** + * @defgroup Static_SetPropertySimple + * @details A set of functions that takes a property as parameter and set its value with the configuration file + * @param propertyName the name of the property in config + * @param toSet the property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + + /** + * @defgroup Static_SetPropertyList + * @details A set of functions that takes a property List as parameter and adds elements in it based on the configuration file + * @param propertyName the name of the property in config + * @param toSet the List property to set + * @param data the node of the templated property property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, GameObject &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, Vector3 &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, Vector2 &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, Rect &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, int &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, float &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, bool &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertySimple + */ + static void setProperty(const std::string& propertyName, std::string &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + + + + + /** + * @ingroup SetPropertyList + */ + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(std::string propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(std::string propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + /** + * @ingroup SetPropertyList + */ + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + + static void setProperty(const std::string& propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + + + /** + * @details , doesn't touch it if property is not found + * @tparam T the type of the property to set, it's type can be an unknown type class as long as its constructor can take an xml node to construct the object + * @param propertyName the name of the property in config + * @param toSet the property to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + static void setProperty(std::string propertyName, T &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG) + { + std::shared_ptr property = _findProperty(std::move(propertyName), data, level); + + if (property == nullptr) + return; + + toSet = T(property); + }; + + /** + * @details sets a property List by its name, doesn't touch it if property is not found + * @tparam T the type of the properties Elements of the List to set, it's type can be an unknown type class as long as its constructor can take an xml node to construct the object + * @param propertyName the name of the property in config + * @param toSet the property List to set + * @warning propertyName as to be the exact same as the literal property name in the component ! + */ + template + static void setProperty(std::string propertyName, std::vector &toSet, std::shared_ptr &data, Logger::severity level = Logger::DEBUG) + { + auto propNode = _findProperty(propertyName, data, level); + + if (propNode == nullptr) + return; + + for (auto &element : *propNode) { + try { + toSet.emplace_back(element); + } catch (...) { + Logger::log("Property List of Templates named '" + + propertyName + "': has no value", + Logger::DEBUG); + } + } + }; + private: + /** + * @details Searches a property by its attribute 'name' in the component node + * @param name the value of the attribute called 'name' in the property node to find + * @return the node found (nullptr if not found) + */ + std::shared_ptr _findProperty(const std::string& name, Logger::severity level = Logger::DEBUG); + static std::shared_ptr _findProperty(const std::string& name, std::shared_ptr &data, Logger::severity level = Logger::DEBUG); + static bool _setPropertyFromAttr(const std::string& name, int &toSet, myxmlpp::Node &data, Logger::severity level = Logger::DEBUG); + static bool _setPropertyFromAttr(const std::string& name, float &toSet, myxmlpp::Node &data, Logger::severity level = Logger::DEBUG); + static bool _setPropertyFromAttr(const std::string& name, bool &toSet, myxmlpp::Node &data, Logger::severity level = Logger::DEBUG); + static bool _setPropertyFromAttr(const std::string& name, std::string &toSet, myxmlpp::Node &data, Logger::severity level = Logger::DEBUG); +//////////////////////--------------------------///////////////////////// + + }; + } +} + +#endif //ENGINE_XMLCOMPONENT_HPP diff --git a/include/Config/XmlEntity.hpp b/include/Config/XmlEntity.hpp new file mode 100644 index 00000000..b782b18f --- /dev/null +++ b/include/Config/XmlEntity.hpp @@ -0,0 +1,64 @@ +/* +** EPITECH PROJECT, 2020 +** XmlEntity.hpp.h +** File description: +** header for XmlEntity.c +*/ + +#ifndef ENGINE_XMLENTITY_HPP +#define ENGINE_XMLENTITY_HPP + +#include +#include + +namespace Polymorph +{ + class Engine; + class Entity; + namespace Config + { + class XmlComponent; + using XmlNode = myxmlpp::Node; + class XmlEntity + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + XmlEntity(std::shared_ptr &node, Engine &engine, std::string projectPath); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + private: + std::vector> _components; + std::vector> _children; + Engine &_engine; + std::shared_ptr _node; + std::string _path; + std::string _fileName; + std::shared_ptr _entity; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + std::string getName() const; + bool isActive() const; + bool isPrefab(); + std::string getId() const; + [[nodiscard]] std::vector getTags() const; + std::string getLayer() const; + std::shared_ptr makeInstance(); + + private: + void _loadComponents(); +//////////////////////--------------------------///////////////////////// + + }; + } + +} + + +#endif //ENGINE_XMLENTITY_HPP diff --git a/include/Config/XmlScene.hpp b/include/Config/XmlScene.hpp new file mode 100644 index 00000000..89458839 --- /dev/null +++ b/include/Config/XmlScene.hpp @@ -0,0 +1,65 @@ +/* +** EPITECH PROJECT, 2020 +** XmlScene.hpp.h +** File description: +** header for XmlScene.c +*/ + +#ifndef ENGINE_XMLSCENE_HPP +#define ENGINE_XMLSCENE_HPP + +#include +#include +#include + +namespace Polymorph + +{ + class Engine; + class Entity; + + namespace Config + { + class XmlEntity; + class XmlScene + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + XmlScene(std::shared_ptr &node, Engine &_engine); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + private: + std::vector> _entities; + Engine &_engine; + std::shared_ptr _projectNode; + std::shared_ptr _sceneDoc; + + std::string _name; + std::string _id; + std::string _path; + bool _first; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + std::string getId(); + std::string getName(); + bool isFirst() const; + std::vector> getEntities(); + + private: + void _loadEntities(); +//////////////////////--------------------------///////////////////////// + + }; + } + +} + + +#endif //ENGINE_XMLSCENE_HPP diff --git a/include/Core/Engine.hpp b/include/Core/Engine.hpp new file mode 100644 index 00000000..17569ed0 --- /dev/null +++ b/include/Core/Engine.hpp @@ -0,0 +1,204 @@ +/* +** EPITECH PROJECT, 2020 +** Polymorph.hpp.h +** File description: +** header for Polymorph.c +*/ + +#ifndef ENGINE_ENGINE_HPP +#define ENGINE_ENGINE_HPP + +#include +#include +#include +#include +#include + +#include "safe_ptr.hpp" +#include "Time.hpp" + + +namespace Polymorph +{ + namespace Config{class XmlEntity;class XmlComponent;} + namespace Settings{class VideoSettings; class AudioSettings; class PhysicsSettings;} + class DisplayModule; + class Scene; + class Time; + class GraphicalAPI; + class ScriptingApi; + + using ExitCode = int; + + /** + * @class Engine Main container class that holds all game data such as : + * Scenes, Prefabs, Configuration files, Settings + */ + class Engine + { + public: +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + /** + * Creates an instance of engine by passing the project path containing all resources needed to load it such as config and assets + * @param projectPath path containing resources to load + * @param projectName name of the main config file in the projectPath (do not include extension cause it's also the window title / project name) + */ + explicit Engine(const std::string &projectPath, std::string projectName); + ~Engine(); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + private: + std::vector> _scenes; + std::vector _prefabs; + std::vector _defaultConfigs; + + std::vector _layers; + std::vector _execOrder; + + static inline bool _exit = false; + static inline ExitCode _exitCode = 0; + + std::string _projectPath; + std::string _projectName; + std::unique_ptr _projectConfig; + + Time _time; + + std::unique_ptr _physicsSettings; + std::unique_ptr _audioSettings; + std::shared_ptr _videoSettings; + safe_ptr _display; + + std::unique_ptr _graphicalApi; + std::unique_ptr _scriptingApi; + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + /** + * @details Getter that fetches the ordered vector of component types. + * Order determines which component has to be updated before others. + * @returns A vector of std::string ordered based on execution order. + */ + std::vector &getExecOrder(){return _execOrder;}; + + /** + * @details Runs the game. + */ + int run(); + + /** + * Loads a script factory from the filepath to an shared library ('.so') + * @param scriptFactoryPath the path to the shared library + * @warning the path must be relative to the executable + */ + void loadScriptingAPI(const std::string& scriptFactoryPath); + + + /** + * Loads a graphical api from the filepath to an shared library ('.so') + * @param graphicalLibPath the path to the shared library + * @warning the path must be relative to the executable + */ + void loadGraphicalAPI(const std::string& graphicalLibPath); + + /** + * Loads the game configuration and inits all gameObjects/Components/Scenes + */ + void loadEngine(); + + static void exit(ExitCode code); + + std::string getProjectPath(); + + std::vector getPrefabs(); + + std::vector getDefaultConfigs(); + + Config::XmlComponent &getDefaultConfig(const std::string& type); + + + + /** + * @details Find a scene by its name, returns the first matched + * @param name the name of the scene to find + * @return the required scene + */ + std::shared_ptr findSceneByName(const std::string& name); + + /** + * @details Find a scene by its id, returns the first matched + * @param id the name of the scene to find + * @return the required scene + */ + std::shared_ptr findSceneById(const std::string& id); + + /** + * Add the provided scene to the engine's scenes list + * @param scene the scene to add + */ + void addScene(const std::shared_ptr& scene); + + + private: + /** + * @details Opens the project configuration + */ + void _openProject(); + + /** + * @details Inits the execution order informations of components at runtime + */ + void _initExectutionOrder(); + + /** + * @details Inits the layer types for game objects + */ + void _initLayers(); + + /** + * @details Inits the physics settings of the engine + */ + void _initPhysicSettings(); + + /** + * @details Inits the audio settings of the engine + */ + void _initAudioSettings(); + + /** + * @details Inits the video settings of the engine + */ + void _initVideoSettings(); + + /** + * @details Inits the debug settings of the engine + */ + void _initDebugSettings(); + + /** + * @details Inits the game prefabs + */ + void _initPrefabs(); + + /** + * @details Inits the components default configs + */ + void _initTemplates(); + /** + * @details Inits the game data + */ + void _initGameData(); +//////////////////////--------------------------///////////////////////// + + }; +} + + +#endif //ENGINE_ENGINE_HPP diff --git a/include/Core/component/base/ACollider2d.hpp b/include/Core/component/base/ACollider2d.hpp new file mode 100644 index 00000000..1e4ed27f --- /dev/null +++ b/include/Core/component/base/ACollider2d.hpp @@ -0,0 +1,84 @@ +/* +** EPITECH PROJECT, 2020 +** Collider2d.hpp +** File description: +** header for Collider2d.c +*/ + +#ifndef ENGINE_ACOLLIDER2D_HPP +#define ENGINE_ACOLLIDER2D_HPP + +#include "Core/component/base/Component.hpp" + + namespace Polymorph + { + class ACollider2dComponent; + using Collider2dBase = std::shared_ptr; + using Collider2d = safe_ptr; + + /** + * @class Collider2dComponent + * @details An abstract component that is used to make new collider shapes (box, circle ...) + * @warning Do not try to use this as a component ! (AddComponent) + */ + class ACollider2dComponent : public Component + { + +///////////////////////////////// Constructors ///////////////////////////////// + public: + ACollider2dComponent(Entity &gameObject, std::string type); + ~ACollider2dComponent(); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + public: + Vector2 offset = {0, 0}; + private: + /** + * @property all colliders encountered at runtime + */ + std::map _encountered; + + /** + * @property the iterator where is placed the instance of the collider + */ + std::vector::iterator _colliderIdx; + + /** + * @property all colliders instantiated in the game + */ + static inline std::vector _allColliders = {}; +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + private: + /** + * As to check collision with any collider shape implementation (box, circle ...) + * @param collider the collider with the collision is checked + * @return true if collision occurs + */ + virtual bool checkCollision(ACollider2dComponent &collider) = 0; + + void update() override; + + /** + * @details BroadCasting collision event functions + */ + void _checkCollisionToBroadCast(ACollider2dComponent &collider); + + void _broadCastCollisionStay(ACollider2dComponent &collider); + void _broadCastCollisionEnter(ACollider2dComponent &collider); + void _broadCastCollisionExit(ACollider2dComponent &collider); +///////////////////////////--------------------------/////////////////////////// + + }; + + + } + +#endif //ENGINE_ACOLLIDER2D_HPP diff --git a/include/Core/component/base/ADrawableComponent.hpp b/include/Core/component/base/ADrawableComponent.hpp new file mode 100644 index 00000000..ec39555d --- /dev/null +++ b/include/Core/component/base/ADrawableComponent.hpp @@ -0,0 +1,68 @@ +/* +** EPITECH PROJECT, 2020 +** DrawableComponent.hpp +** File description: +** header for DrawableComponent.c +*/ + +#ifndef ENGINE_ADRAWABLECOMPONENT_HPP +#define ENGINE_ADRAWABLECOMPONENT_HPP + +#include "component/base/Component.hpp" + +namespace Polymorph +{ + class ADrawableComponent; + using Drawable = safe_ptr; + + class ADrawableComponent : public Component + { +///////////////////////////////// Constructors ///////////////////////////////// + public: + ADrawableComponent(std::string type, Entity &gameObject); +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + public: + Vector2 offset; +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + public: + /** + * @details An overridable method that's called once per frame in the game loop. + */ + void update()override{}; + + /** + * @details An overridable method that's called once in the lifetime of the component. + * It is called before the games start (or upon component creation at runtime). + * @warning Is called even if the enable state of the component is set to false on creation. + */ + void onAwake()override{}; + + /** + * @details An overridable method that's called once in the lifetime of the component, + * It is called before the update method (or upon component creation at runtime). + * @warning Is called ONLY when the enabled state of the component is passed to true. + */ + void start()override{}; + + /** + * @details An overridable method that draws the component if its an drawable only. + * Called once per frame. + */ + virtual void draw() = 0; +///////////////////////////--------------------------/////////////////////////// + + + }; + + +} + +#endif //ENGINE_ADRAWABLECOMPONENT_HPP diff --git a/include/Engine/component/Component.hpp b/include/Core/component/base/Component.hpp similarity index 75% rename from include/Engine/component/Component.hpp rename to include/Core/component/base/Component.hpp index 775391d0..278b8821 100644 --- a/include/Engine/component/Component.hpp +++ b/include/Core/component/base/Component.hpp @@ -11,7 +11,6 @@ #include "IComponent.hpp" #include "safe_ptr.hpp" - namespace Polymorph { // COMPONENT TYPES @@ -20,13 +19,25 @@ namespace Polymorph class Entity; /** - * @class A class that is used to define any behavior for an entity in the game + * @class Component a class that is used to define any behavior for an + * entity in the game */ class Component : public IComponent { + +///////////////////////////////// Constructors ///////////////////////////////// + public: explicit Component(Entity &game_object); Component(const std::string &type, Entity &game_object); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties ///////////////////////////////// + + public: /** * @property A reference to the unique transform component of the entity */ @@ -41,59 +52,65 @@ namespace Polymorph */ bool enabled = true; + protected: + std::string name; + std::string _type; + bool awaked = false; + bool started = false; + + // Entity Re-define + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Methods ///////////////////////////////// + + public: /** * @details An overridable method that's called once per frame in the game loop. */ - void Update()override; + void update()override; /** * @details An overridable method that's called once in the lifetime of the component. * It is called before the games start (or upon component creation at runtime). * @warning Is called even if the enable state of the component is set to false on creation. */ - void OnAwake()override; + void onAwake()override; /** * @details An overridable method that's called once in the lifetime of the component, - * It is called before the Update method (or upon component creation at runtime). + * It is called before the update method (or upon component creation at runtime). * @warning Is called ONLY when the enabled state of the component is passed to true. */ - void Start()override; + void start() override; + + + void setAsStarted() final { started = true;}; + + void setAsAwaked() final { awaked = true;}; + + bool isAwaked() const final {return awaked;} + + bool isStarted() const final {return started;} - /** - * @details An overridable method that draws the component if its an drawable only. - * Called once per frame. - */ - void Draw() override; - void SetAsStarted() final {started = true;}; - void SetAsAwaked() final {awaked = true;}; - bool IsAwaked() const final {return awaked;} - bool IsStarted() const final {return started;} - /** * @details Getter that return's the type of the component. * @return the type of the component as std::string. - */ + */ std::string getType() const final {return _type;} - protected: - std::string name; - std::string _type; - bool awaked = false; - bool started = false; - - // Entity Re-define - public: /** * @details Looks for a component by type * @tparam T: The 'T' type of the component to look for. * @warning The type 'T' must inherit from the Component class to be fetched * @returns A safe pointer to the component 'T' */ - template - safe_ptr GetComponent(); - + template + safe_ptr getComponent(); + /** * @details Looks for a component by type in parent's * @tparam T: The 'T' type of the component to look for. @@ -101,8 +118,8 @@ namespace Polymorph * @returns A safe pointer to the component 'T' */ template - safe_ptr GetComponentInParent(); - + safe_ptr getComponentInParent(); + /** * @details Looks for a component by type in children * @tparam T: The 'T' type of the component to look for. @@ -111,8 +128,8 @@ namespace Polymorph * @returns A safe pointer to the component 'T' */ template - safe_ptr GetComponentInChildren(); - + safe_ptr getComponentInChildren(); + /** * @details Adds a component to the entity * @tparam T: The 'T' type of the component to add. @@ -121,8 +138,8 @@ namespace Polymorph * @warning The type 'T' must inherit from the Component class to be added * @returns A safe pointer to the component 'T' */ - template - safe_ptr AddComponent(); + template + safe_ptr addComponent(); /** * @details Checks if a component of type 'T' exist in the entity @@ -130,8 +147,8 @@ namespace Polymorph * @warning The type 'T' must inherit from the Component class to be checked * @returns True if the component exist */ - template - bool ComponentExist(); + template + bool componentExist(); /** * @details Deletes the component of type 'T' from the entity @@ -139,8 +156,11 @@ namespace Polymorph * @warning The type 'T' must inherit from the Component class to be deleted * @returns True if the component existed and was deleted successfully */ - template - bool DeleteComponent(); + template + bool deleteComponent(); + +///////////////////////////--------------------------/////////////////////////// + }; } diff --git a/include/Core/component/base/Component_templated.hpp b/include/Core/component/base/Component_templated.hpp new file mode 100644 index 00000000..c791032f --- /dev/null +++ b/include/Core/component/base/Component_templated.hpp @@ -0,0 +1,96 @@ +/* +** EPITECH PROJECT, 2020 +** Component_templated.hpp +** File description: +** header for Component_templated.c +*/ + +#ifndef ENGINE_COMPONENT_TEMPLATED_HPP +#define ENGINE_COMPONENT_TEMPLATED_HPP + +#include "safe_ptr.hpp" +#include "Component.hpp" +#include "Entity.hpp" +#include "component/builtins/TransformComponent.hpp" + +namespace Polymorph +{ + + template + safe_ptr Component::getComponent() + { + return gameObject.getComponent(); + } + + /** + * @details Looks for a component by type in parent's + * @tparam T: The 'T' type of the component to look for. + * @warning The type 'T' must inherit from the Component class to be fetched + * @returns A safe pointer to the component 'T' + */ + template + safe_ptr Component::getComponentInParent() + { + if (!!transform.parent()) + return transform.parent()->gameObject.getComponent(); + } + + /** + * @details Looks for a component by type in children + * @tparam T: The 'T' type of the component to look for. + * @warning Using depth first search ! + * @warning The type 'T' must inherit from the Component class to be fetched + * @returns A safe pointer to the component 'T' + */ + template + safe_ptr Component::getComponentInChildren() + { + for (auto &child: transform) + { + auto c = child->getComponent(); + if (!!c) + return c; + } + } + + /** + * @details Adds a component to the entity + * @tparam T: The 'T' type of the component to add. + * @warning Does nothing if the component is already added + * @warning The type 'T' must have an initializer in the component factory to be added this way + * @warning The type 'T' must inherit from the Component class to be added + * @returns A safe pointer to the component 'T' + */ + template + safe_ptr Component::addComponent() + { + return gameObject.addComponent(); + } + + /** + * @details Checks if a component of type 'T' exist in the entity + * @tparam T: The 'T' type of the component to check for. + * @warning The type 'T' must inherit from the Component class to be checked + * @returns True if the component exist + */ + template + bool Component::componentExist() + { + return gameObject.componentExist(); + } + + /** + * @details Deletes the component of type 'T' from the entity + * @tparam T: The 'T' type of the component to delete. + * @warning The type 'T' must inherit from the Component class to be deleted + * @returns True if the component existed and was deleted successfully + */ + template + bool Component::deleteComponent() + { + return gameObject.deleteComponent(); + } + +} + +#endif //ENGINE_COMPONENT_TEMPLATED_HPP diff --git a/include/Core/component/base/IComponent.hpp b/include/Core/component/base/IComponent.hpp new file mode 100644 index 00000000..80dab28e --- /dev/null +++ b/include/Core/component/base/IComponent.hpp @@ -0,0 +1,31 @@ +/* +** EPITECH PROJECT, 2020 +** IComponent.hpp.h +** File description: +** header for IComponent.c +*/ + +#pragma once + +#include + +namespace Polymorph +{ + /** + * @class IComponent interface class for all components + */ + class IComponent + { + // Component Specific + public: + virtual void update() = 0; + virtual void onAwake() = 0; + virtual void start() = 0; + virtual bool isAwaked() const = 0; + virtual void setAsStarted() = 0; + virtual void setAsAwaked() = 0; + virtual bool isStarted() const = 0; + virtual std::string getType() const = 0; + + }; +} diff --git a/include/Core/component/builtins/TransformComponent.hpp b/include/Core/component/builtins/TransformComponent.hpp new file mode 100644 index 00000000..87756c5a --- /dev/null +++ b/include/Core/component/builtins/TransformComponent.hpp @@ -0,0 +1,171 @@ +/* +** EPITECH PROJECT, 2020 +** Transform.hpp.h +** File description: +** header for Transform.c +*/ + +#ifndef ENGINE_TRANSFORMCOMPONENT_HPP +#define ENGINE_TRANSFORMCOMPONENT_HPP + +#include +#include "component/base/Component.hpp" +#include "safe_ptr.hpp" +#include "Vector.hpp" + +namespace Polymorph +{ + using TransformBase = std::shared_ptr; + using Transform = safe_ptr; + + /** + * @class TransformComponent A special component which handles all the + * parent/children relation for entities + */ + class TransformComponent : public Component + { + friend class TransformInitializer; + using iterator = std::vector>::iterator; + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + /** + * Create a transform component with the entity which it belongs to + * @param gameObject the container entity + */ + explicit TransformComponent(Entity &gameObject); +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + + private: + /** + * Position of the entity + */ + Vector3 _position; + + /** + * Rotation of the entity + */ + Vector2 _rotation; + + /** + * Scale of drawable components in the entity + */ + Vector3 _scale; + + /** + * A reference to the parent entity's transform (in the case the entity has a parent) + */ + TransformBase _parent = nullptr; + + /** + * The list of all references to children's entities transforms + */ + std::vector _children; + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + /** + * with this method, the transform is used as a container of children + * This method allows to iterate over the list + * @return An iterator to the begin of the children list + */ + iterator begin() + { + return _children.begin(); + } + + /** + * Delete the relation to a child at the provided index + * @param pos the index of the related entity + */ + void erase(int pos) + { + _children.erase(_children.begin() + pos); + } + + /** + * with this method, the transform is used as a container of children + * This method allows to iterate over the list + * @return An iterator to the end of the children list + */ + iterator end() + { + return _children.end(); + } + + Transform parent(); + + std::size_t nbChildren(); + + bool noChild(); + + const Vector3 &getPosition() const; + + void setPosition(const Vector3 &position); + + void setPositionX(float posX); + + void setPositionY(float posY); + + void setPositionZ(float posZ); + + void move(const Vector3 &delta); + +//TODO do this later +/* + const Vector2 &getRotation() const; + + void setRotation(const Vector2 &rotation); + + void setRotationX(float rotationX); + + void setRotationY(float rotationY); + + + const Vector3 &getScale() const; + + void setScale(const Vector3 &scale); + + void setScaleX(float scaleX); + + void setScaleY(float scaleY); + + void setScaleZ(float scaleZ); +*/ + + void setParent(const std::shared_ptr& parent_ref); + + std::shared_ptr removeChild(TransformComponent &child); + + void setSiblingIndex(int index); + + void setLastSibling(); + + void setFirstSibling(); + + void start() override; + + void update() override; + + private: + void _moveChildren(const Vector3 &delta); + //TODO implement this + /* + void _rotateChildren(const Vector2 &delta); + void _scaleChildren(const Vector3 &delta); + */ +///////////////////////////--------------------------/////////////////////////// + }; +} + +#endif //ENGINE_TRANSFORMCOMPONENT_HPP diff --git a/include/Core/component/builtins/colliders/ColliderCircle2d.hpp b/include/Core/component/builtins/colliders/ColliderCircle2d.hpp new file mode 100644 index 00000000..05974f18 --- /dev/null +++ b/include/Core/component/builtins/colliders/ColliderCircle2d.hpp @@ -0,0 +1,45 @@ +/* +** EPITECH PROJECT, 2020 +** Collider2d.hpp +** File description: +** header for Collider2d.c +*/ + +#ifndef ENGINE_COLLIDER2CIRCLE_HPP +#define ENGINE_COLLIDER2CIRCLE_HPP + +#include "component/base/ACollider2d.hpp" + +namespace Polymorph + { + + class ColliderCircle2dComponent : public ACollider2dComponent + { + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit ColliderCircle2dComponent(Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + +///////////////////////////////// Properties /////////////////////////////////// + + public: + float radius = 0.0f; + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + private: + bool checkCollision(ACollider2dComponent &other) override; + +///////////////////////////--------------------------/////////////////////////// + + }; + } + +#endif //ENGINE_COLLIDER2CIRCLE_HPP diff --git a/include/Core/component/builtins/colliders/ColliderRect2d.hpp b/include/Core/component/builtins/colliders/ColliderRect2d.hpp new file mode 100644 index 00000000..fd0c8c2e --- /dev/null +++ b/include/Core/component/builtins/colliders/ColliderRect2d.hpp @@ -0,0 +1,45 @@ +/* +** EPITECH PROJECT, 2020 +** Collider2d.hpp +** File description: +** header for Collider2d.c +*/ + +#ifndef ENGINE_COLLIDER2RECT_HPP +#define ENGINE_COLLIDER2RECT_HPP + +#include "component/base/ACollider2d.hpp" + +namespace Polymorph + { + + class ColliderRect2dComponent : public ACollider2dComponent + { + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit ColliderRect2dComponent(Entity &entity); + +///////////////////////////--------------------------/////////////////////////// + +///////////////////////////////// Properties /////////////////////////////////// + + public: + Vector2 size = {0, 0}; + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + private: + bool checkCollision(ACollider2dComponent &other) override; + +///////////////////////////--------------------------/////////////////////////// + + }; + } + +#endif //ENGINE_COLLIDER2RECT_HPP diff --git a/include/Core/component/builtins/drawables/SpriteRendererComponent.hpp b/include/Core/component/builtins/drawables/SpriteRendererComponent.hpp new file mode 100644 index 00000000..6b286043 --- /dev/null +++ b/include/Core/component/builtins/drawables/SpriteRendererComponent.hpp @@ -0,0 +1,39 @@ +/* +** EPITECH PROJECT, 2020 +** SpriteRenderComponent.hpp +** File description: +** header for SpriteRenderComponent.c +*/ + +#ifndef ENGINE_SPRITERENDERERCOMPONENT_HPP +#define ENGINE_SPRITERENDERERCOMPONENT_HPP + + +#include "component/base/ADrawableComponent.hpp" + +namespace Polymorph +{ + class SpriteModule; + using Sprite = safe_ptr; + class SpriteRendererComponent; + using SpriteRenderer = safe_ptr; + using SpriteRendererBase = std::shared_ptr; + + class SpriteRendererComponent : public ADrawableComponent + { + public: + explicit SpriteRendererComponent(Entity &gameObject); + + + public: + Sprite sprite; + + + + public: + void draw() override; + + }; +} + +#endif //ENGINE_SPRITERENDERERCOMPONENT_HPP diff --git a/include/Core/component/builtins/drawables/TextRendererComponent.hpp b/include/Core/component/builtins/drawables/TextRendererComponent.hpp new file mode 100644 index 00000000..a3f59db2 --- /dev/null +++ b/include/Core/component/builtins/drawables/TextRendererComponent.hpp @@ -0,0 +1,37 @@ +/* +** EPITECH PROJECT, 2020 +** TextRendererComponent.hpp +** File description: +** header for TextRendererComponent.c +*/ + +#ifndef ENGINE_TEXTRENDERERCOMPONENT_HPP +#define ENGINE_TEXTRENDERERCOMPONENT_HPP + +#include "component/base/ADrawableComponent.hpp" + +namespace Polymorph +{ + class TextModule; + using Text = safe_ptr; + class TextRendererComponent; + using TextRenderer = safe_ptr; + using TextRendererBase = std::shared_ptr; + + class TextRendererComponent : public ADrawableComponent + { + public: + explicit TextRendererComponent(Entity &gameObject); + + + public: + Text text; + + + + public: + void draw() override; + }; +} + +#endif //ENGINE_TEXTRENDERERCOMPONENT_HPP diff --git a/include/Engine/entity/Entity.hpp b/include/Core/entity/Entity.hpp similarity index 76% rename from include/Engine/entity/Entity.hpp rename to include/Core/entity/Entity.hpp index 338f20cb..c4026830 100644 --- a/include/Engine/entity/Entity.hpp +++ b/include/Core/entity/Entity.hpp @@ -14,40 +14,66 @@ #include #include "safe_ptr.hpp" -#include "XmlEntity.hpp" namespace Polymorph { class Component; class AComponentInitializer; class Engine; + class TransformComponent; namespace Config{ class XmlEntity; class XmlComponent; } - + /** - * @class A container class which is defined by the components it holds. + * @class Entity a container class which is defined by the components it + * holds. */ class Entity { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// public: - Entity(); - Entity(std::shared_ptr &data, std::shared_ptr &game); + Entity(Config::XmlEntity &data, Engine &game); ~Entity(); - + +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: /** * @property The unique mandatory component of an entity * it's like his identity in the world. */ - std::shared_ptr transform; - + std::shared_ptr transform = nullptr; + /** * @property The entity's name (not necessarily unique) */ std::string name; - + + private: + bool _isPrefab; + bool _active; + std::string _stringId; + std::vector _tags; + std::string _layer; + Engine &_game; + std::vector _order; + Config::XmlEntity &_xml_config; + std::unordered_map>> _components; +//////////////////////--------------------------///////////////////////// + + + + + +/////////////////////////////// METHODS //////////////////////////////////// + public: + /** * @details Check for game object state * @returns The state of the game object @@ -84,24 +110,30 @@ namespace Polymorph * @details Updates the game object by updating in the component execution order * all components. */ - void Update(); + void update(); + + /** + * @details start the game object by starting the components + */ + void start(); /** * @details Looks for the drawable component of the entity, - * then calls Draw() of children. + * then calls draw() of children. */ - void Draw(); + void draw(); /** * @details Draws the children */ - void DrawChildren(TransformComponent &trm); + void drawChildren(TransformComponent &trm); /** - * @details Awakes the entity by calling OnAwake() of the components + * @details Awakes the entity by calling onAwake() of the components */ - void Awake(); + void awake(); + void addComponent(std::string &component, Config::XmlComponent &config); /** * @details Looks for a component by type @@ -110,10 +142,17 @@ namespace Polymorph * @returns A safe pointer to the component 'T' */ template - safe_ptr GetComponent(); - - void addComponent(std::string &component, Config::XmlComponent &config); + safe_ptr getComponent(); + /** + * @details Looks for all components of type T + * @tparam T: The 'T' type of the components to look for. + * @warning The type 'T' must inherit from the Component class to be fetched + * @returns A vector of safe pointer to the components of type 'T' + */ + template + std::vector> getComponents(); + /** * @details Adds a component to the entity * @tparam T: The 'T' type of the component to add. @@ -123,16 +162,17 @@ namespace Polymorph * @returns A safe pointer to the component 'T' */ template - safe_ptr AddComponent(); + safe_ptr addComponent(); /** * @details Checks if a component of type 'T' exist in the entity * @tparam T: The 'T' type of the component to check for. * @warning The type 'T' must inherit from the Component class to be checked + * @bug is not found by compiler !!! * @returns True if the component exist */ template - bool componentExist() const; + bool componentExist(); /** * @details Deletes the component of type 'T' from the entity @@ -141,7 +181,7 @@ namespace Polymorph * @returns True if the component existed and was deleted successfully */ template - bool DeleteComponent(); + bool deleteComponent(); /** * @details A getter to fetch the entity's name @@ -155,6 +195,13 @@ namespace Polymorph */ std::string &getId() {return _stringId;}; + /** + * @details A getter to fetch the XmlEntity associated with the + * entity + * @returns The associated XmlEntity + */ + Config::XmlEntity &getXmlConfig() const noexcept; + /** * @details Comparator operator that compares 2 entities based on unique id. * @param entity: the entity to compare with. @@ -201,14 +248,9 @@ namespace Polymorph private: bool componentExist(std::string &type); - bool _isPrefab; - bool _active; - std::string _stringId; - std::vector _tags; - std::string _layer; - std::shared_ptr _game; - std::vector _order; - std::unordered_map>> _components; +//////////////////////--------------------------///////////////////////// + + }; using GameObject = safe_ptr; diff --git a/include/Core/entity/Entity_templated.hpp b/include/Core/entity/Entity_templated.hpp new file mode 100644 index 00000000..b8df1a34 --- /dev/null +++ b/include/Core/entity/Entity_templated.hpp @@ -0,0 +1,111 @@ +/* +** EPITECH PROJECT, 2020 +** Entity_templated.hpp +** File description: +** header for Entity_templated.c +*/ + +#ifndef ENGINE_ENTITY_TEMPLATED_HPP +#define ENGINE_ENTITY_TEMPLATED_HPP + +#include +#include +#include + +#include "safe_ptr.hpp" +#include "Engine.hpp" + +#include "ComponentsFactory/ComponentFactory.hpp" +#include "ScriptingAPI/ScriptingApi.hpp" +#include "Log/Logger.hpp" +#include "Entity.hpp" +#include "component/base/Component.hpp" +#include "XmlComponent.hpp" + +namespace Polymorph +{ + + template + safe_ptr Entity::getComponent() + { + for (auto &ci: _components) { + for (auto &c: ci.second) { + auto toAdd = std::dynamic_pointer_cast((*c).get()); + if (toAdd != nullptr) { + return safe_ptr(toAdd); + } + } + } + return safe_ptr(nullptr); + } + + template + std::vector> Entity::getComponents() + { + std::vector> toReturn; + + for (auto &ci: _components) { + for (auto &c: ci.second) { + auto toAdd = std::dynamic_pointer_cast((*c).get()); + if (toAdd != nullptr) { + toReturn.push_back(safe_ptr(toAdd)); + } + } + } + + return toReturn; + } + + template + safe_ptr Entity::addComponent() + { + std::shared_ptr component(new T(*this)); + + std::string t = component->getType(); + component.reset(); + if (componentExist(t)) + return safe_ptr(nullptr); + //TODO: maybe throw/Log ? + Config::XmlComponent &config = _game.getDefaultConfig(t); + + std::shared_ptr c = ComponentFactory::create(t, config, *this); + if (c == nullptr) + c = ScriptingApi::create(t, config, *this); + + if (c == nullptr) { + Logger::log("Unknown component to add at runtime: '" + t + + "'\n\t(this error maybe occurs because you need to add an initializer for the component in the factory)", + Logger::MINOR); + return safe_ptr(nullptr); + } + + if (config.getType() != "Empty") { + c->build(); + c->reference(); + } + _components[c->getType()].push_back(c); + (**c)->onAwake(); + (**c)->setAsAwaked(); + if ((**c)->enabled) + { + (**c)->start(); + (**c)->setAsStarted(); + } + return safe_ptr(std::dynamic_pointer_cast((*c).get())); + } + + template + bool Entity::componentExist() + { + for (auto &ci: _components) { + for (auto &c: ci.second) + { + if (std::dynamic_pointer_cast((*c).get() ) != nullptr) + return true; + } + } + return false; + } +} + +#endif //ENGINE_ENTITY_TEMPLATED_HPP diff --git a/include/Engine/scene/Scene.hpp b/include/Core/scene/Scene.hpp similarity index 56% rename from include/Engine/scene/Scene.hpp rename to include/Core/scene/Scene.hpp index 833df9b4..23b28b13 100644 --- a/include/Engine/scene/Scene.hpp +++ b/include/Core/scene/Scene.hpp @@ -13,9 +13,9 @@ #include #include #include -#include "factory/ComponentInitializer.hpp" -#include "ref_ptr.hpp" +#include +#include "safe_ptr.hpp" namespace Polymorph @@ -26,28 +26,43 @@ namespace Polymorph class Engine; class Entity; + using GameObject = safe_ptr; + using EntityIterator = std::vector>::iterator; class Timer; /** - * @class A container class that's store's all entities from a game scene + * @class Scene a container class that's store's all entities from a game scene */ class Scene { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// public: - Scene(std::shared_ptr &data, std::shared_ptr &game); + Scene(std::shared_ptr &data, Engine &game); + explicit Scene(std::string sceneName, Engine &game); +//////////////////////--------------------------///////////////////////// + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + std::string name; + std::string id; private: std::vector> _entities; std::map, Entity&> _destroyQueueList; - std::string &_id; - std::shared_ptr _game; + Engine &_game; std::shared_ptr _config_data; +//////////////////////--------------------------///////////////////////// + + +/////////////////////////////// METHODS ///////////////////////////////// public: /** * @details Loops trough entities twice: - * Once to call Update - * Then to call Draw + * Once to call update + * Then to call draw * Finally updates the destroy queue * GameObject(nullptr) if not found. */ @@ -57,31 +72,37 @@ namespace Polymorph * @details Generates Entities and their Components from configuration files. */ void loadScene(); - + /** * @details Erases all entities and their components from scene */ void unloadScene(); /** - * @details Check for entities to erase based on their delay, + * @details Check for entities to _erase based on their delay, * with their respective timer. * Erases them if time's up. */ void updateDestroyQueueList(); - + + /** + * @details Get all entities of a list + * @returns An array of safe_ptr to the entities in the scene + */ + std::vector getAll() const noexcept; + /** * @details Looks for the first occurrence of entity with the parameter name - * @param name: The name of the entity to find - * @return A safe_ptr to an Entity (alias GameObject type) + * @param needle: The name of the entity to find + * @return A safe_ptr to an Entity (alias GameObject type) * GameObject(nullptr) if not found. */ - GameObject find(const std::string &name); + GameObject find(const std::string &needle); /** * @details Looks for all occurrences of entities with the parameter name * @param name: The name of the entities to find - * @return A vector of safe_ptr to entities (alias GameObject type) + * @return A vector of safe_ptr to entities (alias GameObject type) */ std::vector findAll(const std::string &name); @@ -90,12 +111,12 @@ namespace Polymorph * @details Looks for the first occurrence of entity with has the tag * passed as parameter. * @param tag: The filter tag - * @return A safe_ptr to an Entity (alias GameObject type). + * @return A safe_ptr to an Entity (alias GameObject type). * GameObject(nullptr) if not found. */ GameObject findByTag(const std::string &tag); - + /** * @details Looks for all occurrences of entities filtered by the tag parameter * @param tag: The filter tag @@ -108,30 +129,39 @@ namespace Polymorph * @details Looks for an entity by it's unique id * passed as parameter. * @param id: the unique id of the entity - * @return A safe_ptr to an Entity (alias GameObject type). + * @return A safe_ptr to an Entity (alias GameObject type). * GameObject(nullptr) if not found. */ GameObject findById(const std::string &id); - /** - * @details Erase an entity (and his children) from scene - * @param entity: the entity to erase + * @details Looks for an entity by it's unique id + * passed as parameter. + * @param id: the unique id of the entity + * @return A iterator to an Entity (alias GameObject type). + * end() if not found. */ - void Erase(Entity &entity); + EntityIterator findItById(const std::string &id); + /** + * @details Add an entity to the entities list + * @param entity a shared_ptr to an entity to add in the list + */ + void addEntity(const std::shared_ptr& entity); /** - * @details Erase an entity (and his children) from scene - * @param entity: the entity to erase - */ - void Erase(std::string &id); + * @details Add an entity to the entities list at the desired index + * @param entity a shared_ptr to an entity to add in the list + * @param idx the desired index + */ + void addEntityAtIdx(const std::shared_ptr& entity, std::size_t idx); + /** * @details Adds an entity to the destroy queue of the scene * @param entity: the entity to push in queue */ - void Destroy(Entity &entity); + void destroy(Entity &entity); /** @@ -139,17 +169,41 @@ namespace Polymorph * @param entity: the entity to push in queue * @param delayInSeconds: The delay in seconds before destroying it once in queue */ - void Destroy(Entity &entity, float delayInSeconds); - + void destroy(Entity &entity, float delayInSeconds); + + /** + * @details Remove an entity iterator + * @param it: entity iterator to remove + */ + std::shared_ptr pop(EntityIterator it); + + /** + * @return number of parent entity in the scene + */ + std::size_t countParents(); + private: + /** + * @details Erase an entity (and his children) from scene + * @param entity: the entity to _erase + */ + void _erase(Entity &entity); + + /** + * @details Erase an entity (and his children) from scene + * @param entity: the entity to _erase + */ + void _erase(std::string &id); + /** * @details Counts all children in an entity * @param entity: An iterator of the parent entity * @param parent_id: The id of the parent entity * @returns The total count of children and sub-children of an entity */ - int countChildren(std::vector>::iterator &entity, std::string &parent_id); + int _countChildren(std::vector>::iterator &entity, std::string &parent_id); +//////////////////////--------------------------///////////////////////// }; } diff --git a/include/Engine/SceneManager.hpp b/include/Core/scene/SceneManager.hpp similarity index 60% rename from include/Engine/SceneManager.hpp rename to include/Core/scene/SceneManager.hpp index c96473c9..33fa3e93 100644 --- a/include/Engine/SceneManager.hpp +++ b/include/Core/scene/SceneManager.hpp @@ -8,70 +8,96 @@ #ifndef ENGINE_SCENEMANAGER_HPP #define ENGINE_SCENEMANAGER_HPP -#include "default/TransformComponent.hpp" -#include "Entity.hpp" +#include +#include +#include "safe_ptr.hpp" namespace Polymorph { + class Entity; + class TransformComponent; + + using GameObject = safe_ptr; + using Transform = safe_ptr; + class Vector3; + class Engine; class Scene; + /** - * @class An utility class used to manipulate scenes + * @class SceneManager An utility class used to manipulate scenes * @category GameObject : static functions used to browse game objects in current scene * @category Scene : static functions used to manipulate different scenes */ class SceneManager { + +///////////////////////////// PROPERTIES //////////////////////////////// + public: // Properties + static inline std::shared_ptr Current = nullptr; + static inline std::shared_ptr Game = nullptr; + static inline std::vector> KeepOnLoad; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// public: // GameObject Section - + /** * @details Fetch all actual entities in scene * @returns A vector of references to the actual entities */ - static std::vector GetAll(); + static std::vector getAll(); /** * @details Finds the first occurrence of a game object in scene by name * @param name: The name of the game object to find * @returns A smart pointer (safe_ptr) of the entity found (empty safe_ptr if not found) */ - static GameObject Find(std::string name); + static GameObject find(const std::string& name); /** * @details Finds all occurrences of game objects in scene by name * @param name: The name of the game objects to find * @returns A vector of smart pointers (safe_ptr) of game objects found (empty vector if not found) */ - static std::vector FindAll(std::string name); + static std::vector findAll(const std::string& name); + /** + * @details Finds a game object in scene by its unique id + * @param id: The unique id of the game object to find + * @returns A smart pointer (safe_ptr) of the entity found (empty safe_ptr if not found) + */ + static GameObject findById(const std::string& id); /** * @details Finds the first occurrence of a game object in scene by tag * @param tag: The tag of the game object to find * @returns A smart pointer (safe_ptr) of the entity found (empty safe_ptr if not found) */ - static GameObject FindByTag(std::string tag); + static GameObject findByTag(const std::string& tag); /** * @details Finds all occurrences of game objects in scene by tag - * @param tag: The tag which is used to filter game objects + * @param tag: The tag which is used to filter game objects * @returns A vector of smart pointers (safe_ptr) of game objects found (empty vector if not found) */ - static std::vector FindAllByTag(std::string tag); + static std::vector findAllByTag(const std::string& tag); /** * @details Destroy's a game object from the scene - * @param gameObject: The game object to destroy + * @param gameObject: The game object to destroy */ - static void Destroy(GameObject gameObject); + static void destroy(GameObject& gameObject); /** * @details Destroy's a game object from the scene - * @param gameObject: The game object to destroy + * @param gameObject: The game object to destroy * @param delay: The delay in seconds before destroying it */ - static void Destroy(GameObject gameObject, float delay); + static void destroy(GameObject gameObject, float delay); /** @@ -79,7 +105,7 @@ namespace Polymorph * @param gameObject: the game object to clone * @returns the instantiated game object */ - static GameObject Instantiate(GameObject gameObject); + static GameObject instantiate(GameObject& gameObject); /** * @details Instantiate a game object in scene (makes a clone of it) @@ -87,16 +113,16 @@ namespace Polymorph * @param position: the position at which the game object is instantiated * @returns the instantiated game object */ - static GameObject Instantiate(GameObject gameObject, Vector3 position); - + static GameObject instantiate(GameObject gameObject, const Vector3& position); + /** * @details Instantiate a game object in scene (makes a clone of it) * @param gameObject: the game object to clone * @param parent: the parent transform on which the instantiated object will depend on * @returns the instantiated game object */ - static GameObject Instantiate(GameObject gameObject, Transform parent); - + static GameObject instantiate(GameObject gameObject, Transform parent); + /** * @details Instantiate a game object in scene (makes a clone of it) * @param gameObject: the game object to clone @@ -104,11 +130,30 @@ namespace Polymorph * @param offset: the offset position from the parent object * @returns the instantiated game object */ - static GameObject Instantiate(GameObject gameObject, Transform parent, Vector3 offset); - + static GameObject instantiate(GameObject gameObject, Transform parent, Vector3 offset); + + /** + * @details Set the position of a parent entity at the front of the scene entities list + * @param gameObject the game object to move at front + */ + static void setAtFront(GameObject gameObject); + + /** + * @details Set the position of a parent entity a the desired index in the scene entities list + * @param gameObjectthe game object to move + * @param idx the index to move the game object at + */ + static void setAtIdx(GameObject gameObject, std::size_t idx); + + /** + * @details Set the position of a parent entity at the back of the scene entities list + * @param gameObject: the game object to move to back + */ + static void setAtBack(GameObject gameObject); + // End of GameObject Section - - + + public: // Scene Section /** @@ -116,14 +161,14 @@ namespace Polymorph * newly loaded one. * @param name: Name of the scene to load */ - static void LoadScene(std::string name); + static void loadScene(std::string name); /** * @details Creates an empty scene (runtime only) * @param name: Name of the scene to load */ - static void CreateScene(std::string name); + static void createScene(std::string name); /** @@ -132,14 +177,11 @@ namespace Polymorph * @useless Passing a prefab (which is always accessible in any scenes) * @param gameObject: The game object to keep upon loading */ - static void DontDestroyOnLoad(GameObject gameObject); + static void dontDestroyOnLoad(GameObject gameObject); // End of Scene Section +//////////////////////--------------------------///////////////////////// - public: // Properties - static inline std::shared_ptr Current = nullptr; - static inline std::shared_ptr Game = nullptr; - static inline std::vector> KeepOnLoad; }; } #endif //ENGINE_SCENEMANAGER_HPP diff --git a/include/Core/settings/AudioSettings.hpp b/include/Core/settings/AudioSettings.hpp new file mode 100644 index 00000000..323e46a6 --- /dev/null +++ b/include/Core/settings/AudioSettings.hpp @@ -0,0 +1,80 @@ +/* +** EPITECH PROJECT, 2020 +** AudioSettings.hpp +** File description: +** header for AudioSettings.c +*/ + +#ifndef ENGINE_AUDIOSETTINGS_HPP +#define ENGINE_AUDIOSETTINGS_HPP + +#include + +namespace Polymorph::Settings { + using XmlNode = myxmlpp::Node; + class AudioSettings + { + +///////////////////////////////// Constructors ///////////////////////////////// + public: + /** + * Construct an AudioSettings by passing the AudioSettings XML + * node from the configuration file + * @param node The AudioSettings node + */ + explicit AudioSettings(const std::shared_ptr &node); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties ///////////////////////////////// + + private: + const std::shared_ptr &_node; + + int _masterVolume = 0; + int _musicVolume = 0; + int _sfxVolume = 0; + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Methods ///////////////////////////////// + + private: + int _getVolume(const std::string &attrName); + + public: + /** + * Get the master volume as a percentage + * @return The master volume + */ + int getMasterVolume() const; + + /** + * Get the music volume as a percentage + * @return The music volume + */ + int getMusicVolume() const; + + /** + * Get the sfx volume as a percentage + * @return The sfx volume + */ + int getSfxVolume() const; + + void setMasterVolume(int vol); + + void setMusicVolume(int vol); + + void setSfxVolume(int vol); + +///////////////////////////--------------------------/////////////////////////// + + }; +} + + +#endif //ENGINE_AUDIOSETTINGS_HPP diff --git a/include/Core/settings/PhysicsSettings.hpp b/include/Core/settings/PhysicsSettings.hpp new file mode 100644 index 00000000..4b4b8f25 --- /dev/null +++ b/include/Core/settings/PhysicsSettings.hpp @@ -0,0 +1,66 @@ +/* +** EPITECH PROJECT, 2020 +** PhysicsSettings.hpp +** File description: +** header for PhysicsSettings.c +*/ + +#ifndef ENGINE_PHYSICSSETTINGS_HPP +#define ENGINE_PHYSICSSETTINGS_HPP + +#include +#include "types/Vector.hpp" + +namespace Polymorph::Settings +{ + using XmlNode = myxmlpp::Node; + + class PhysicsSettings { + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit PhysicsSettings(const std::shared_ptr& node); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties ///////////////////////////////// + + private: + const std::shared_ptr &_node; + Vector2 _2DGravity = {0, -9.81}; + Vector3 _3DGravity = {0, 0, -9.81}; + enum gravityMode {TWO_D, THREE_D}; // TODO: check if it is usefull (wtf) + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Methods ///////////////////////////////// + + private: + void _init2DGravity(); + void _init3DGravity(); + void _createDefault2DGrav(); + void _createDefault3DGrav(); + static void _saveToAttribute(const std::shared_ptr &node, const std::string &dimension, const std::string &attrName, float value); + + public: + Vector2 getGravity2D(); + Vector3 getGravity3D(); + + void setGravity2D(Vector2 newGrav); + void setGravity2D(float newYGrav); + + void setGravity3D(Vector3 newGrav); + void setGravity3D(float newZGrav); + +///////////////////////////--------------------------/////////////////////////// + + }; +} + + +#endif //ENGINE_PHYSICSSETTINGS_HPP diff --git a/include/Core/settings/VideoSettings.hpp b/include/Core/settings/VideoSettings.hpp new file mode 100644 index 00000000..a2069598 --- /dev/null +++ b/include/Core/settings/VideoSettings.hpp @@ -0,0 +1,86 @@ +/* +** EPITECH PROJECT, 2020 +** VideoSettings.hpp +** File description: +** header for VideoSettings.c +*/ + +#ifndef ENGINE_VIDEOSETTINGS_HPP +#define ENGINE_VIDEOSETTINGS_HPP + +#include +#include "types/Vector.hpp" + +namespace Polymorph::Settings { + using XmlNode = myxmlpp::Node; + + class VideoSettings { + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit VideoSettings(const std::shared_ptr &node); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties ///////////////////////////////// + + private: + bool _defaultMode = false; + int _maxFps = 60; + bool _fullscreen = false; + bool _resizable = false; + int _bitsPerPixel = 32; + Vector2 _resolution; + + const std::shared_ptr &_node; + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Methods ///////////////////////////////// + + private: + bool _initBoolVal(const std::string &attrName); + + int _initIntVal(const std::string &attrName); + + Vector2 _initResolution() const; + + static void _saveToAttribute(const std::shared_ptr &node, const std::string &attrName, float value); + + public: + bool getDefaultMode() const; + + int getMaxFps() const; + + bool getFullscreen() const; + + bool getResizable() const; + + int getBitsPerPixel() const; + + Vector2 getResolution() const; + + void setDefaultMode(bool mode); + + void setMaxFps(int fps); + + void setFullscreen(bool fullscreen); + + void setResizable(bool resizable); + + void setBitsPerPixel(int bitsPerPixel); + + void setResolution(Vector2 resolution); + +///////////////////////////--------------------------/////////////////////////// + + }; +} + + +#endif //ENGINE_VIDEOSETTINGS_HPP diff --git a/include/DynamicLoader/DynamicLoader.hpp b/include/DynamicLoader/DynamicLoader.hpp new file mode 100644 index 00000000..cc5f364c --- /dev/null +++ b/include/DynamicLoader/DynamicLoader.hpp @@ -0,0 +1,51 @@ +/* +** EPITECH PROJECT, 2020 +** DynamicLoader.hpp +** File description: +** header for DynamicLoader.c +*/ + +#ifndef ENGINE_DYNAMICLOADER_HPP +#define ENGINE_DYNAMICLOADER_HPP + +#include +#include +#include +#include + +class DynamicLibLoader +{ + public: + ~DynamicLibLoader(); + + protected: + void *_handler = nullptr; + + + public: + /** + * @details Close the previous opened library (if one is open) and opens the one passed as parameter + * @param libPath + */ + void loadHandler(const std::string& libPath); + + + protected: + template + static T loadSymbol(std::string name) + { + auto handler = API::getHandler(); + + if (handler == nullptr) + return nullptr; + + void *symbol = dlsym(handler, name.c_str()); + + if (symbol == nullptr) + throw std::runtime_error("Failed to find symbol named: "+ name); + return reinterpret_cast(symbol); + } +}; + + +#endif //ENGINE_DYNAMICLOADER_HPP diff --git a/include/Engine/Application.hpp b/include/Engine/Application.hpp deleted file mode 100644 index 1ce205c0..00000000 --- a/include/Engine/Application.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Application.hpp -** File description: -** header for Application.cpp -*/ - -#ifndef ENGINE_APPLICATION_HPP -#define ENGINE_APPLICATION_HPP - -#include -#include "Engine.hpp" - -namespace Polymorph -{ - using ExitCode = int; - - class Application - { - public: - static void Quit(ExitCode code); - - static inline std::string assetsPath = ""; - - static inline std::shared_ptr Game = nullptr; - }; -} - -#endif //ENGINE_APPLICATION_HPP diff --git a/include/Engine/Engine.hpp b/include/Engine/Engine.hpp deleted file mode 100644 index 8f12b834..00000000 --- a/include/Engine/Engine.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Polymorph.hpp.h -** File description: -** header for Polymorph.c -*/ - -#ifndef ENGINE_ENGINE_HPP -#define ENGINE_ENGINE_HPP - -#include -#include -#include -#include -#include "Entity.hpp" - - -namespace Polymorph -{ - namespace Config{class XmlEngine{};} - class Scene; - - /** - * @class Main container class that holds all game data such as : - * Scenes, Prefabs, Configuration files, Settings - */ - class Engine - { - public: - explicit Engine(const std::string &filepath); - - private: - using ExitCode = int; - std::vector> _scenes; - std::vector _prefabs; - std::vector _defaultConfigs; - std::vector _tags; - std::vector _layers; - std::vector _execOrder; - Config::XmlEngine _data; - bool _exit = false; - ExitCode _exitCode = 0; - - - public: - /** - * @details Getter that fetches the ordered vector of component types. - * Order determines which component has to be updated before others. - * @returns A vector of std::string ordered based on execution order. - */ - std::vector &getExecOrder(){return _execOrder;}; - - /** - * @details Runs the game. - */ - int run(); - - void Exit(ExitCode code); - }; -} - - -#endif //ENGINE_ENGINE_HPP diff --git a/include/Engine/Utilities/Time.hpp b/include/Engine/Utilities/Time.hpp deleted file mode 100644 index a43463a2..00000000 --- a/include/Engine/Utilities/Time.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Time.hpp.h -** File description: -** header for Time.c -*/ - -#ifndef ENGINE_TIME_HPP -#define ENGINE_TIME_HPP - -#include - -namespace Polymorph -{ - class Time - { - public: - static inline float deltaTime = 0.0f; - }; - - class Timer - { - public: - Timer()= default; - explicit Timer(float delay); - float delay = 0; - float actual = 0; - void tick(); - bool timeIsUp(bool isReset = true);; - }; - -} - -#endif //ENGINE_TIME_HPP diff --git a/include/Engine/Utilities/Types/Rect.hpp b/include/Engine/Utilities/Types/Rect.hpp deleted file mode 100644 index a8d2469a..00000000 --- a/include/Engine/Utilities/Types/Rect.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Rect.hpp.h -** File description: -** header for Rect.c -*/ - -#ifndef ENGINE_RECT_HPP -#define ENGINE_RECT_HPP - -#include "Vector.hpp" - -namespace Polymorph -{ - class Rect - { - public: - Rect(float x, float y, float w, float h) - : x(x), y(y), width(w), height(h){}; - - Rect(Vector2 &position, float w, float h) - : x(position.x), y(position.y), width(w), height(h){}; - - Rect(Vector2 &position, Vector2 &size) - : x(position.x), y(position.y), width(size.x), height(size.y){}; - - Rect(float x, float y, Vector2 &size) - : x(x), y(y), width(size.x), height(size.y){}; - ~Rect() = default; - - Rect(Rect ©) = default;; - - Rect(): x(0), y(0), width(0), height(0){}; - - float x; - float y; - float width; - float height; - static Rect Zero; - - }; -} - - -#endif //ENGINE_RECT_HPP diff --git a/include/Engine/Utilities/Types/Vector.hpp b/include/Engine/Utilities/Types/Vector.hpp deleted file mode 100644 index b3538fbb..00000000 --- a/include/Engine/Utilities/Types/Vector.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Vector2.hpp.h -** File description: -** header for Vector2.c -*/ - -#ifndef ENGINE_VECTOR_HPP -#define ENGINE_VECTOR_HPP - - -namespace Polymorph -{ - class Vector2; - class Vector3 - { - public: - Vector3(float x, float y): x(x), y(y), z(0){}; - Vector3(float x, float y, float z): x(x), y(y), z(z){}; - Vector3(Vector3 ©) = default; - explicit Vector3(Vector2 ©); - Vector3(): x(0), y(0), z(0){}; - ~Vector3() = default; - - float x; - float y; - float z; - static Vector3 Zero; - }; - - - - class Vector2 - { - public: - Vector2(float x, float y): x(x), y(y){}; - Vector2(Vector2 ©) = default; - explicit Vector2(Vector3 ©); - Vector2(): x(0), y(0){}; - ~Vector2() = default; - - float x; - float y; - static Vector2 Zero; - }; -} - -#endif //ENGINE_VECTOR_HPP diff --git a/include/Engine/Utilities/ref_ptr.hpp b/include/Engine/Utilities/ref_ptr.hpp deleted file mode 100644 index 30c2d289..00000000 --- a/include/Engine/Utilities/ref_ptr.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** CollectorPtr.hpp.h -** File description: -** header for CollectorPtr.c -*/ - -#ifndef ENGINE_REF_PTR_HPP -#define ENGINE_REF_PTR_HPP - -#include -#include -#include -#include - -namespace Polymorph -{ - template - class ref_ptr : public std::reference_wrapper - { - public: - ref_ptr() : std::reference_wrapper(){}; - explicit ref_ptr(T data) : std::reference_wrapper(data){}; - - T &operator*() - { - return this->get(); - } - }; -} - -#endif //ENGINE_REF_PTR_HPP diff --git a/include/Engine/component/IComponent.hpp b/include/Engine/component/IComponent.hpp deleted file mode 100644 index c411175c..00000000 --- a/include/Engine/component/IComponent.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** IComponent.hpp.h -** File description: -** header for IComponent.c -*/ - -#ifndef ENGINE_ICOMPONENT_HPP -#define ENGINE_ICOMPONENT_HPP - -#include - -namespace Polymorph -{ - /** - * @class A Sub class - */ - class IComponent - { - // Component Specific - public: - virtual void Update() = 0; - virtual void OnAwake() = 0; - virtual void Start() = 0; - virtual bool IsAwaked() const = 0; - virtual void SetAsStarted() = 0; - virtual void SetAsAwaked() = 0; - virtual bool IsStarted() const = 0; - virtual void Draw() = 0; - virtual std::string getType() const = 0; - - }; -} - -#endif //ENGINE_ICOMPONENT_HPP diff --git a/include/Engine/component/default/TransformComponent.hpp b/include/Engine/component/default/TransformComponent.hpp deleted file mode 100644 index 0c6727da..00000000 --- a/include/Engine/component/default/TransformComponent.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** Transform.hpp.h -** File description: -** header for Transform.c -*/ - -#ifndef ENGINE_TRANSFORMCOMPONENT_HPP -#define ENGINE_TRANSFORMCOMPONENT_HPP - -#include -#include "Component.hpp" -#include "ref_ptr.hpp" -#include "safe_ptr.hpp" -#include "Vector.hpp" - -namespace Polymorph -{ - using TransformBase = std::shared_ptr; - using Transform = safe_ptr; - - class TransformComponent : public Component - { - public: - - explicit TransformComponent(Entity &gameObject); - - Vector3 position; - Vector3 rotation; - Vector3 scale; - TransformBase parent; - std::vector children; - - typedef std::vector>::iterator iterator; - iterator begin() - { - return children.begin(); - } - - void erase(int pos) - { - children.erase(children.begin() + pos); - } - - iterator end() - { - return children.end(); - } - - void SetParent(std::shared_ptr parent); - - std::shared_ptr RemoveChild(TransformComponent &child); - void SetSiblingIndex(int index); - void SetLastSibling(); - void SetFirstSibling(); - - private: - void UpdateChildren(); - - }; -} - -#endif //ENGINE_TRANSFORMCOMPONENT_HPP diff --git a/include/Engine/component/factory/ComponentFactory.hpp b/include/Engine/component/factory/ComponentFactory.hpp deleted file mode 100644 index 33f1d08b..00000000 --- a/include/Engine/component/factory/ComponentFactory.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** ComponentFactory.hpp.h -** File description: -** header for ComponentFactory.c -*/ - -// @TEMPLATE: -// {"*", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new *Initializer(data, entity));}}, - -#ifndef ENGINE_COMPONENTFACTORY_HPP -#define ENGINE_COMPONENTFACTORY_HPP - -#include "factory/ComponentInitializer.hpp" -#include -#include -#include -#include -#include - -// @COMPONENTS: (add components include here) -#include "factory/initializers/TransformInitializer.hpp" - - -namespace Polymorph -{ - class ComponentFactory - { - public: - using Initializer = std::shared_ptr; - - static Initializer create(std::string &type, Config::XmlComponent &data, Entity &entity) - { - if (!_buildables.contains(type)) - return nullptr; - return _buildables[type](data, entity); - }; - - private: - static inline std::map> - _buildables = - { - // @INITIALIZERS: (add Component Initializers here) - // @TRANSFORM: - { - "Transform", [](Config::XmlComponent &data, Entity &entity) -> Initializer{ return Initializer(new TransformInitializer(data, entity));} - }, - }; - }; -} - -#endif //ENGINE_COMPONENTFACTORY_HPP diff --git a/include/Engine/component/factory/initializers/TransformInitializer.hpp b/include/Engine/component/factory/initializers/TransformInitializer.hpp deleted file mode 100644 index 43fcf58a..00000000 --- a/include/Engine/component/factory/initializers/TransformInitializer.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** TransformInitializer.hpp.h -** File description: -** header for TransformInitializer.c -*/ - -#ifndef ENGINE_TRANSFORMINITIALIZER_HPP -#define ENGINE_TRANSFORMINITIALIZER_HPP - -#include "factory/ComponentInitializer.hpp" -#include "XmlComponent.hpp" -#include "XmlEntityRef.hpp" -#include "default/TransformComponent.hpp" - -namespace Polymorph -{ - class TransformInitializer : public AComponentInitializer - { - public: - - TransformInitializer(Config::XmlComponent &data, Entity &entity) - : AComponentInitializer( "Transform", data, entity){ - component = std::shared_ptr(new TransformComponent(entity)); - }; - - std::shared_ptr &build() final - { - TransformBase &trm = dynamic_cast(*component); - trm->position = data.getVector3Property("position"); - trm->rotation = data.getVector3Property("rotation"); - trm->scale = data.getVector3Property("scale"); - return component; - }; - void reference() final { - TransformBase &trm = dynamic_cast(*component); - for (auto &ref: data.getEntityReferencePropertylList("Children")) - (*ref)->transform->SetParent(trm); - } - - }; -} - -#endif //ENGINE_TRANSFORMINITIALIZER_HPP diff --git a/include/Engine/config/XmlComponent.hpp b/include/Engine/config/XmlComponent.hpp deleted file mode 100644 index f117d95f..00000000 --- a/include/Engine/config/XmlComponent.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlComponent.hpp.h -** File description: -** header for XmlComponent.c -*/ - -#ifndef ENGINE_XMLCOMPONENT_HPP -#define ENGINE_XMLCOMPONENT_HPP - -#include -#include -#include -#include "Vector.hpp" -#include "Rect.hpp" -#include "safe_ptr.hpp" - -namespace Polymorph -{ - - class Scene; - class Entity; - namespace Config - { - using XmlNode = void *; - - /** - * @class The class that interfaces a Component Xml Node and the actual Component - * inside the engine. - * @ - */ - class XmlComponent - { - public: - /** - * @details Looks for the initial state of the component in the config - * @return the component enable state - */ - bool isEnabled(); - - /** - * @details Looks for the component type in the component's config file - * @return The type of the component - */ - std::string getType(); - - /** - * @details Looks for a Vector3 property in the component's config file - * @param name: the name of the property to look for - * @return An Vector3 property - */ - Vector3 getVector3Property(std::string name); - - - /** - * @details Looks for a Vector2 property in the component's config file - * @param name: the name of the property to look for - * @return An Vector2 property - */ - Vector2 getVector2Property(std::string name); - - /** - * @details Looks for a Rect property in the component's config file - * @param name: the name of the property to look for - * @return An Rect property - */ - Rect getRectProperty(std::string name); - - - /** - * @details Looks for a character string property in the component's config file - * @param name: the name of the property to look for - * @return An std::string property - */ - std::string getStringProperty(std::string name); - - /** - * @details Looks for a integer property in the component's config file - * @param name: the name of the property to look for - * @return An int property - */ - int getIntProperty(std::string name); - - /** - * @details Looks for a floating point property in the component's config file - * @param name: the name of the property to look for - * @return An float property - */ - float getFloatProperty(std::string name); - - /** - * @details Looks for a boolean property in the component's config file - * @param name: the name of the property to look for - * @return An bool property - */ - bool getBoolProperty(std::string name); - - /** - * @details Looks for a component reference property in the component's config file, - * then with the data found it uses it to search the entity->component requested - * in the engine. - * @tparam T: the T type of the component to look for - * @param name: the name of the property to look for - * @return A smart pointer (safe_ptr) of the component property - */ - template - safe_ptr getComponentReferenceProperty(std::string name); - - /** - * @details Looks for an entity reference property in the component's config file, - * then with the data found it uses it to search the entity requested - * in the engine. - * @param name: the name of the property to look for - * @return An smart pointer (safe_ptr) of the entity (alias GameObject) property - */ - safe_ptr getEntityReferenceProperty(std::string name); - - /** - * @details Looks for an LIST of entity reference property in the component's config file, - * then with the data found it uses it to search the entities requested - * in the engine. - * @param name: the name of the property to look for - * @return An vector of smart pointer (safe_ptr) of entities (alias GameObject) - */ - std::vector> getEntityReferencePropertylList(std::string name); - - /** - * @details Looks for an custom property in the component's config file, - * then with the data found it tries to build the custom object by passing - * the data found to it's constructor - * @tparam T: the 'T' type of the object config to look for - * @warning Never try to call this with an object type that doesn't have a proper constructor ! - * @param name: the name of the property to look for - * @return An instance of the custom object requested - */ - template - T getTemplatedProperty(std::string name); - - /** - * - * @details Looks for an custom property in the component's config file, - * then with the data found it tries to build the custom object by passing - * the data found to it's constructor - * @tparam T: the 'T' type of the objects configs to look for - * @warning Never try to call this with an object type that doesn't have a proper constructor ! - * @param name: the name of the property to look for - * @return An list of instances of the custom objects requested - */ - template - std::vector getListOfTemplatedProperty(std::string name); - - private: - - std::string type; - std::shared_ptr node; - std::shared_ptr scene; - }; - } -} - -#endif //ENGINE_XMLCOMPONENT_HPP diff --git a/include/Engine/config/XmlComponentRef.hpp b/include/Engine/config/XmlComponentRef.hpp deleted file mode 100644 index f9d86648..00000000 --- a/include/Engine/config/XmlComponentRef.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlComponentRef.hpp -** File description: -** header for XmlComponentRef.c -*/ - -#ifndef ENGINE_XMLCOMPONENTREF_HPP -#define ENGINE_XMLCOMPONENTREF_HPP - -#include "XmlEntityRef.hpp" - -namespace Polymorph::Config -{ - - template - class XmlComponentRef : public XmlEntityRef - { - public: - XmlComponentRef(XmlNode &node, Scene &scene); - safe_ptr getComponentReference(); - - }; -} - -#endif //ENGINE_XMLCOMPONENTREF_HPP diff --git a/include/Engine/config/XmlEngine.hpp b/include/Engine/config/XmlEngine.hpp deleted file mode 100644 index 7727313e..00000000 --- a/include/Engine/config/XmlEngine.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlEngine.hpp.h -** File description: -** header for XmlEngine.c -*/ - -#ifndef ENGINE_XMLENGINE_HPP -#define ENGINE_XMLENGINE_HPP - -namespace Polymorph::Config -{ - class XmlEngine { - - }; -} - - -#endif //ENGINE_XMLENGINE_HPP diff --git a/include/Engine/config/XmlEntity.hpp b/include/Engine/config/XmlEntity.hpp deleted file mode 100644 index 357ae740..00000000 --- a/include/Engine/config/XmlEntity.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlEntity.hpp.h -** File description: -** header for XmlEntity.c -*/ - -#ifndef ENGINE_XMLENTITY_HPP -#define ENGINE_XMLENTITY_HPP - -#include -#include "XmlComponent.hpp" - -namespace Polymorph -{ - class Engine; - class Entity; - namespace Config - { - - class XmlEntity - { - public: - XmlEntity(std::shared_ptr &node, std::shared_ptr &engine); - std::string &getName() const; - bool isActive() const; - std::string &getId() const; - [[nodiscard]] std::vector getTags() const; - std::string getLayer() const; - std::shared_ptr makeInstance(); - - private: - std::vector> _components; - std::vector> _children; - std::shared_ptr _engine; - std::shared_ptr _node; - }; - } - -} - - -#endif //ENGINE_XMLENTITY_HPP diff --git a/include/Engine/config/XmlEntityRef.hpp b/include/Engine/config/XmlEntityRef.hpp deleted file mode 100644 index 91740a27..00000000 --- a/include/Engine/config/XmlEntityRef.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlEntityRef.hpp -** File description: -** header for XmlEntityRef.c -*/ - -#ifndef ENGINE_XMLENTITYREF_HPP -#define ENGINE_XMLENTITYREF_HPP - -#include -#include "Entity.hpp" - -namespace Polymorph -{ - class Scene; - - namespace Config - { - class XmlEntityRef - { - public: - explicit XmlEntityRef(XmlNode &node, Scene &scene); - GameObject getReference(); - - - private: - std::string _id; - Scene &_scene; - }; - } -} - -#endif //ENGINE_XMLENTITYREF_HPP diff --git a/include/Engine/config/XmlScene.hpp b/include/Engine/config/XmlScene.hpp deleted file mode 100644 index 7154c95a..00000000 --- a/include/Engine/config/XmlScene.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** XmlScene.hpp.h -** File description: -** header for XmlScene.c -*/ - -#ifndef ENGINE_XMLSCENE_HPP -#define ENGINE_XMLSCENE_HPP - -#include -#include - -namespace Polymorph - -{ - class Engine; - class Entity; - - namespace Config - { - class XmlEntity; - class XmlScene { - public: - XmlScene(Engine &_engine); - std::vector> getEntities(); - std::string &getId(); - - - private: - std::vector> _entities; - Engine &_engine; - - }; - } - -} - - -#endif //ENGINE_XMLSCENE_HPP diff --git a/include/Events/ICollider2dHandler.hpp b/include/Events/ICollider2dHandler.hpp new file mode 100644 index 00000000..90ead365 --- /dev/null +++ b/include/Events/ICollider2dHandler.hpp @@ -0,0 +1,25 @@ +/* +** EPITECH PROJECT, 2020 +** IColliderHandler.hpp +** File description: +** header for IColliderHandler.c +*/ + +#ifndef ENGINE_ICOLLIDER2DHANDLER_HPP +#define ENGINE_ICOLLIDER2DHANDLER_HPP + +namespace Polymorph +{ + class ACollider2dComponent; + + + class ICollider2dHandler + { + public: + virtual void onCollisionEnter(ACollider2dComponent &collider) = 0; + virtual void onCollisionExit(ACollider2dComponent &collider) = 0; + virtual void onCollisionStay(ACollider2dComponent &collider) = 0; + }; +} + +#endif //ENGINE_ICOLLIDER2DHANDLER_HPP diff --git a/include/Events/IDragHandler.hpp b/include/Events/IDragHandler.hpp new file mode 100644 index 00000000..1849da39 --- /dev/null +++ b/include/Events/IDragHandler.hpp @@ -0,0 +1,24 @@ +/* +** EPITECH PROJECT, 2020 +** IPointerDragHandler.hpp +** File description: +** header for IPointerDragHandler.c +*/ + +#ifndef ENGINE_IDRAGHANDLER_HPP +#define ENGINE_IDRAGHANDLER_HPP + +namespace Polymorph +{ + class PointerEvent; + + class IDragHandler + { + public: + virtual void onDrag(PointerEvent &event) = 0; + virtual void onDragBegin(PointerEvent &event) = 0; + virtual void onDragEnd(PointerEvent &event) = 0; + }; +} + +#endif //ENGINE_IDRAGHANDLER_HPP diff --git a/include/Events/IDropHandler.hpp b/include/Events/IDropHandler.hpp new file mode 100644 index 00000000..9ec90d39 --- /dev/null +++ b/include/Events/IDropHandler.hpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2020 +** IDropHandler.hpp +** File description: +** header for IDropHandler.c +*/ + +#ifndef ENGINE_IDROPHANDLER_HPP +#define ENGINE_IDROPHANDLER_HPP + +namespace Polymorph +{ + class PointerEvent; + + class IDropHandler + { + public: + virtual void onDrop(PointerEvent &event) = 0; + virtual void checkDrop(PointerEvent &event) = 0; + }; +} + +#endif //ENGINE_IDROPHANDLER_HPP diff --git a/include/Events/IPointerClickHandler.hpp b/include/Events/IPointerClickHandler.hpp new file mode 100644 index 00000000..4ce798ca --- /dev/null +++ b/include/Events/IPointerClickHandler.hpp @@ -0,0 +1,24 @@ +/* +** EPITECH PROJECT, 2020 +** IPointerClickHandler.hpp +** File description: +** header for IPointerClickHandler.c +*/ + +#ifndef ENGINE_IPOINTERCLICKHANDLER_HPP +#define ENGINE_IPOINTERCLICKHANDLER_HPP + +namespace Polymorph +{ + class PointerEvent; + + class IPointerClickHandler + { + public: + virtual void onPointerDown(PointerEvent &event) = 0; + virtual void onPointerHold(PointerEvent &event) = 0; + virtual void onPointerUp(PointerEvent &event) = 0; + }; +} + +#endif //ENGINE_IPOINTERCLICKHANDLER_HPP diff --git a/include/Events/IPointerHandler.hpp b/include/Events/IPointerHandler.hpp new file mode 100644 index 00000000..9c3030ba --- /dev/null +++ b/include/Events/IPointerHandler.hpp @@ -0,0 +1,25 @@ +/* +** EPITECH PROJECT, 2020 +** IPointerHandler.hpp +** File description: +** header for IPointerHandler.c +*/ + +#ifndef ENGINE_IPOINTERHANDLER_HPP +#define ENGINE_IPOINTERHANDLER_HPP + +namespace Polymorph +{ + class PointerEvent; + + class IPointerHandler + { + public: + virtual void onPointerEnter(PointerEvent &event) = 0; + virtual void onPointerHover(PointerEvent &event) = 0; + virtual void onPointerExit(PointerEvent &event) = 0; + }; +} + + +#endif //ENGINE_IPOINTERHANDLER_HPP diff --git a/include/Exceptions/ConfigurationException.hpp b/include/Exceptions/ConfigurationException.hpp new file mode 100644 index 00000000..f62a361a --- /dev/null +++ b/include/Exceptions/ConfigurationException.hpp @@ -0,0 +1,27 @@ +/* +** EPITECH PROJECT, 2020 +** ConfigurationException.hpp +** File description: +** header for ConfigurationException.c +*/ + +#ifndef ENGINE_CONFIGURATIONEXCEPTION_HPP +#define ENGINE_CONFIGURATIONEXCEPTION_HPP + + + +#include "Exceptions/ExceptionLogger.hpp" + +class ConfigurationException : public ExceptionLogger +{ +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit ConfigurationException(const std::string& message, Logger::severity level = Logger::severity::MAJOR); + +///////////////////////////--------------------------/////////////////////////// + +}; + + +#endif //ENGINE_CONFIGURATIONEXCEPTION_HPP diff --git a/include/Exceptions/ExceptionLogger.hpp b/include/Exceptions/ExceptionLogger.hpp new file mode 100644 index 00000000..81403a7b --- /dev/null +++ b/include/Exceptions/ExceptionLogger.hpp @@ -0,0 +1,46 @@ +/* +** EPITECH PROJECT, 2020 +** ExceptionLogger.hpp +** File description: +** header for ExceptionLogger.c +*/ + +#ifndef ENGINE_EXCEPTIONLOGGER_HPP +#define ENGINE_EXCEPTIONLOGGER_HPP + +#include +#include "Log/Logger.hpp" + +class ExceptionLogger : public std::exception +{ + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + explicit ExceptionLogger(std::string message, Logger::severity level = Logger::severity::MAJOR); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties ///////////////////////////////// + + private: + std::string _message; + Logger::severity _level; + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Methods ///////////////////////////////// + + public: + const char *what() const noexcept override; + +///////////////////////////--------------------------/////////////////////////// + +}; + + +#endif //ENGINE_EXCEPTIONLOGGER_HPP diff --git a/include/Exceptions/GraphicalException.hpp b/include/Exceptions/GraphicalException.hpp new file mode 100644 index 00000000..e5fbbaec --- /dev/null +++ b/include/Exceptions/GraphicalException.hpp @@ -0,0 +1,24 @@ +/* +** EPITECH PROJECT, 2020 +** GraphicalException.hpp +** File description: +** header for GraphicalException.c +*/ + +#ifndef ENGINE_GRAPHICALEXCEPTION_HPP +#define ENGINE_GRAPHICALEXCEPTION_HPP + + +#include "ExceptionLogger.hpp" + +class GraphicalException : public ExceptionLogger +{ +///////////////////////////////// Constructors ///////////////////////////////// + public: + explicit GraphicalException(const std::string& apiMessage, Logger::severity level = Logger::MAJOR); +///////////////////////////--------------------------/////////////////////////// + +}; + + +#endif //ENGINE_GRAPHICALEXCEPTION_HPP diff --git a/include/GraphicalAPI/GraphicalAPI.hpp b/include/GraphicalAPI/GraphicalAPI.hpp new file mode 100644 index 00000000..4e57f19f --- /dev/null +++ b/include/GraphicalAPI/GraphicalAPI.hpp @@ -0,0 +1,107 @@ +/* +** EPITECH PROJECT, 2020 +** GraphicalAPI.hpp +** File description: +** header for GraphicalAPI.c +*/ + + +#pragma once + +#include +#include "safe_ptr.hpp" +#include "DynamicLoader/DynamicLoader.hpp" + +namespace arcade{class ISpriteModule; class ITextModule; class IDisplayModule;} + +namespace Polymorph +{ + namespace Settings{class VideoSettings;} + class SpriteModule; + class TextModule; + class DisplayModule; + + + using Sprite = safe_ptr; + using SpriteBase = std::shared_ptr; + + using Text = safe_ptr; + using TextBase = std::shared_ptr; + + using Display = safe_ptr; + using DisplayBase = std::shared_ptr; + + class GraphicalAPI : public DynamicLibLoader + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + explicit GraphicalAPI(std::string handlerPath); + + ~GraphicalAPI(); + +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + static inline DisplayModule *CurrentDisplay = nullptr; + + + private: + std::string _handlerPath; + std::vector _sprites; + std::vector _texts; + std::vector _displays; + static inline GraphicalAPI *_instance = nullptr; + + using TextLoader = arcade::ITextModule *(*)(); + using TextUnloader = void (*)(arcade::ITextModule *module); + + TextLoader _c_text = nullptr; + TextUnloader _d_text = nullptr; + + using SpriteLoader = arcade::ISpriteModule *(*)(); + using SpriteUnloader = void (*)(arcade::ISpriteModule *module); + + SpriteLoader _c_sprite = nullptr; + SpriteUnloader _d_sprite = nullptr; + + using DisplayLoader = arcade::IDisplayModule *(*)(); + using DisplayUnloader = void (*)(arcade::IDisplayModule *module); + + DisplayLoader _c_display = nullptr; + DisplayUnloader _d_display = nullptr; + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + static Sprite createSprite(std::shared_ptr &data); + static Sprite createSprite(std::string filePath); + static Text createText(std::shared_ptr &data); + static Text createText(unsigned int size, std::string fontPath, std::string text = ""); + static Display createDisplay(std::shared_ptr videoSettings, std::string title); + + static void destroySprite(SpriteModule *sprite); + static void destroyText(TextModule *text); + static void destroyDisplay(DisplayModule *display); + + static void reloadAPI(std::string newHandler); + static void *getHandler(); + static std::string getHandlerPath(); + + private: + static void _unloadModules(); + static void _reloadModules(); + +//////////////////////--------------------------///////////////////////// + }; + +} + + + diff --git a/include/GraphicalAPI/Input.hpp b/include/GraphicalAPI/Input.hpp new file mode 100644 index 00000000..7a224385 --- /dev/null +++ b/include/GraphicalAPI/Input.hpp @@ -0,0 +1,56 @@ +/* +** EPITECH PROJECT, 2020 +** Input.hpp +** File description: +** header for Input.c +*/ + + +#pragma once + +#include "GraphicalAPI/arcade/IDisplayModule.hpp" + +namespace Polymorph +{ + + class Input + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + + private: + std::map _pressedKeys; + std::map _releasedKeys; + std::map _holdedKeys; + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + static bool isKeyDown(arcade::KeyCode code); + static bool isKeyUp(arcade::KeyCode code); + static bool isKeyHold(arcade::KeyCode code); + + static bool isMouseButtonDown(arcade::KeyCode buttonNb); + static bool isMouseButtonUp(arcade::KeyCode buttonNb); + static bool isMouseButtonHold(arcade::KeyCode buttonNb); + + private: + +//////////////////////--------------------------///////////////////////// + + }; +} + + + diff --git a/include/GraphicalAPI/arcade/IAudioModule.hpp b/include/GraphicalAPI/arcade/IAudioModule.hpp new file mode 100644 index 00000000..6644ca96 --- /dev/null +++ b/include/GraphicalAPI/arcade/IAudioModule.hpp @@ -0,0 +1,31 @@ +#include + +namespace arcade +{ + class IAudioModule + { + public: + + virtual ~IAudioModule() = default; + // ALL FILE TYPES MUST BE AT THE PATH SPECIFIED + // MUST: loads and set an audio file + //ex SFML: + // assetPath = ./Assets/Pacman/enemy/sound + // real path = ./Assets/Pacman/enmey/font.ttf + + virtual void setSource(std::string source_path) = 0; + + // MUST play the audio source (maybe instantiate it here) + virtual void play() = 0; + + // MUST pause the audio source + virtual void pause() = 0; + + // MUST Stop the audio source (maybe destroy the instance here) + virtual void stop() = 0; + + // Must set the volume + virtual void setVolume(float volume) = 0; + + }; +} \ No newline at end of file diff --git a/include/GraphicalAPI/arcade/IDisplayModule.hpp b/include/GraphicalAPI/arcade/IDisplayModule.hpp new file mode 100644 index 00000000..d3ca6a6c --- /dev/null +++ b/include/GraphicalAPI/arcade/IDisplayModule.hpp @@ -0,0 +1,198 @@ +#pragma once + +#include + +namespace arcade +{ + class ISpriteModule; + + class ITextModule; + + enum KeyCode + { + A, // The A key. + B, // The B key. + C, // The C key. + D, // The D key. + E, // The E key. + F, // The F key. + G, // The G key. + H, // The H key. + I, // The I key. + J, // The J key. + K, // The K key. + L, // The L key. + M, // The M key. + N, // The N key. + O, // The O key. + P, // The P key. + Q, // The Q key. + R, // The R key. + S, // The S key. + T, // The T key. + U, // The U key. + V, // The V key. + W, // The W key. + X, // The X key. + Y, // The Y key. + Z, // The Z key. + Num0, // The 0 key. + Num1, // The 1 key. + Num2, // The 2 key. + Num3, // The 3 key. + Num4, // The 4 key. + Num5, // The 5 key. + Num6, // The 6 key. + Num7, // The 7 key. + Num8, // The 8 key. + Num9, // The 9 key. + Escape, // The Escape key. + LControl, // The left Control key. + LShift, // The left Shift key. + LAlt, // The left Alt key. + LSystem, // The left OS specific key: window (Windows and Linux), apple (MacOS X), ... + RControl, // The right Control key. + RShift, // The right Shift key. + RAlt, // The right Alt key. + RSystem, // The right OS specific key: window (Windows and Linux), apple (MacOS X), ... + Menu, // The Menu key. + LBracket, // The [ key. + RBracket, // The ] key. + Semicolon, // The ; key. + Comma, // The , key. + Period, // The . key. + Quote, // The ' key. + Slash, // The / key. + Backslash, // The \ key. + Tilde, // The ~ key. + Equal, // The = key. + Hyphen, // The - key (hyphen) + Space, // The Space key. + Enter, // The Enter/Return keys. + Backspace, // The Backspace key. + Tab, // The Tabulation key. + PageUp, // The Page up key. + PageDown, // The Page down key. + End, // The End key. + Home, // The Home key. + Insert, // The Insert key. + Delete, // The Delete key. + Add, // The + key. + Subtract, // The - key (minus, usually from numpad) + Multiply, // The * key. + Divide, // The / key. + Left, // Left arrow. + Right, // Right arrow. + Up, // Up arrow. + Down, // Down arrow. + Numpad0, // The numpad 0 key. + Numpad1, // The numpad 1 key. + Numpad2, // The numpad 2 key. + Numpad3, // The numpad 3 key. + Numpad4, // The numpad 4 key. + Numpad5, // The numpad 5 key. + Numpad6, // The numpad 6 key. + Numpad7, // The numpad 7 key. + Numpad8, // The numpad 8 key. + Numpad9, // The numpad 9 key. + F1, // The F1 key. + F2, // The F2 key. + F3, // The F3 key. + F4, // The F4 key. + F5, // The F5 key. + F6, // The F6 key. + F7, // The F7 key. + F8, // The F8 key. + F9, // The F9 key. + F10, // The F10 key. + F11, // The F11 key. + F12, // The F12 key. + F13, // The F13 key. + F14, // The F14 key. + F15, // The F15 key. + Pause, // The Pause key. + KeyCount, // Keep last – the total number of keyboard keys. + MouseButton1, // Left Click + MouseButton2, // RightClick + MouseButton3, // MiddleClick + + }; + + class IDisplayModule + { + public: + virtual ~IDisplayModule() = default; + + public: + // INPUTS : + + // MUST: tell if the key is pressed (if held down must only tell once) + virtual bool isKeyPressed(KeyCode Code) = 0; + + // MUST: return the actual x position of the mouse + virtual int getMouseXPosition() = 0; + + // MUST: return the actual y position of the mouse + virtual int getMouseYPosition() = 0; + + // MUST : Stores inputs (must be called once per frame, ex: before any logic calls to use them of course) + virtual void fetchInputs() = 0; + // ex: a map of key codes that says if they are pressed or not + + ///////////////////////////////////////////////////////// + + + + + public: + // WINDOW : + + // MUST : sets resolution (does what you want in ncurse) + virtual void setResolution(int x, int y) = 0; + + // MUST : return the width of the window + virtual unsigned int getWindowWidth() = 0; + + // MUST : return the height of the window + virtual unsigned int getWindowHeight() = 0; + + // MUST : sets Fps (if possible) + virtual void setFps(int fps) = 0; + + // MUST : sets the window title (if possible) + virtual void setWindowTitle(std::string title) = 0; + + // MUST : sets the display in fullscreen or not (does what you want in ncurse) + virtual void setFullScreen(bool fullScreen) = 0; + + // MUST : tell if the window / program is still running + virtual bool isOpen() = 0; + + // MUST : tell if the display is type text or not + virtual bool isTextMode() = 0; + + // MUST: clears the window + virtual void clearWindow() = 0; + + // MUST: display the content + virtual void displayWindow() = 0; + + //MUST: close the window and set the isOpen() return to false + virtual void closeWindow() = 0; + + ///////////////////////////////////////////////////////// + + + + public: + // DRAW LOGIC: + + // MUST : draw a sprite module + virtual void draw(ISpriteModule *sprite) = 0; + + // MUST : draw a text module + virtual void draw(ITextModule *text) = 0; + + ///////////////////////////////////////////////////////// + }; +} diff --git a/include/GraphicalAPI/arcade/ISpriteModule.hpp b/include/GraphicalAPI/arcade/ISpriteModule.hpp new file mode 100644 index 00000000..6769850c --- /dev/null +++ b/include/GraphicalAPI/arcade/ISpriteModule.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include +namespace arcade +{ + class ISpriteModule + { + public: + virtual ~ISpriteModule() = default; + + // USED ONLY IN WRAPPER + //MUST : return the object sprite or texture to draw + virtual void *getSprite() = 0; + + // ALL FILE TYPES MUST BE AT THE PATH SPECIFIED + // MUST: set a sprite (ex: creates a texture then a sprite from it in SFML) + //ex SFML: assetPath = ./Assets/Pacman/enemy/goblin/enemy + // assetPath = ./Assets/Pacman/enemy/goblin/enemy + // real path (inside sfml implementation) =./Assets/Pacman/enmey/goblin/enemy.png or .jpeg + virtual void setSprite(std::string filePath) = 0; + + // MUST: set position of the sprite + virtual void setPosition(float x, float y) = 0; + + // MUST: move the sprite + virtual void move(float x, float y) = 0; + + // MUST: set texture crop to the sprite (does maybe nothing based on lib) + virtual void setCrop(int x, int y, int width, int height) = 0; + + // MUST: set the sprite color + virtual void + setColor(unsigned char r, unsigned char g, unsigned char b) = 0; + }; +} \ No newline at end of file diff --git a/include/GraphicalAPI/arcade/ITextModule.hpp b/include/GraphicalAPI/arcade/ITextModule.hpp new file mode 100644 index 00000000..094de80f --- /dev/null +++ b/include/GraphicalAPI/arcade/ITextModule.hpp @@ -0,0 +1,37 @@ +#include + +namespace arcade +{ + class ITextModule + { + public: + virtual ~ITextModule() = default; + + // USED ONLY IN WRAPPER + // MUST : return the text object to draw + virtual void *getText() = 0; + + // MUST: set the text value + virtual void setText(std::string text) = 0; + + // MUST: Set the text position; + virtual void setPosition(float x, float y) = 0; + + // MUST: move the text + virtual void move(float x, float y) = 0; + + // ALL FILE TYPES MUST BE AT THE PATH SPECIFIED + // MUST: loads and set a text font + //ex SFML: + // assetPath = ./Assets/Pacman/enemy/font + // real path = ./Assets/Pacman/enmey/font.ttf + virtual void setFont(std::string font) = 0; + + // MUST: Set the text color + virtual void + setColor(unsigned char r, unsigned char g, unsigned char b) = 0; + + // MUST: Set the text size + virtual void setSize(int size) = 0; + }; +} \ No newline at end of file diff --git a/include/GraphicalAPI/modules/DisplayModule.hpp b/include/GraphicalAPI/modules/DisplayModule.hpp new file mode 100644 index 00000000..7a0397d4 --- /dev/null +++ b/include/GraphicalAPI/modules/DisplayModule.hpp @@ -0,0 +1,80 @@ +/* +** EPITECH PROJECT, 2020 +** Display.hpp +** File description: +** header for Display.c +*/ + +#ifndef ENGINE_DISPLAYMODULE_HPP +#define ENGINE_DISPLAYMODULE_HPP + + +#include +#include +#include + +#include "Vector.hpp" + +//TODO: find a way to not have multiples definitions of interfaces +#include "GraphicalAPI/arcade/IDisplayModule.hpp" + +namespace arcade{class IDisplayModule;} +namespace Polymorph +{ + namespace Settings{class VideoSettings;} + class SpriteModule; + class TextModule; + class GraphicalAPI; + + class DisplayModule + { + +///////////////////////////////// Constructors ///////////////////////////////// + public: + DisplayModule(std::shared_ptr settings, std::string title); + ~DisplayModule(); + +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + public: + + private: + std::string _title; + arcade::IDisplayModule *_displayModule = nullptr; + std::shared_ptr _settings; + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + public: + void clearWindow(); + void displayWindow(); + void close(); + bool isOpen(); + void fetchEvents(); + + void setResolution(Vector2 newResolution); + bool isKeyPressed(arcade::KeyCode code); + Vector2 getResolution(); + void setMaxFps(int fps); + void setFullScreen(bool fullScreen); + bool isTextMode(); + + void draw(SpriteModule &sprite); + void draw(TextModule &sprite); + + + private: + void _loadModule(); + +///////////////////////////--------------------------/////////////////////////// + friend GraphicalAPI; + }; +} + +#endif //ENGINE_DISPLAYMODULE_HPP diff --git a/include/GraphicalAPI/modules/SpriteModule.hpp b/include/GraphicalAPI/modules/SpriteModule.hpp new file mode 100644 index 00000000..5d59fbf8 --- /dev/null +++ b/include/GraphicalAPI/modules/SpriteModule.hpp @@ -0,0 +1,72 @@ +/* +** EPITECH PROJECT, 2020 +** Sprite.hpp +** File description: +** header for Sprite.c +*/ + +#ifndef ENGINE_SPRITEMODULE_HPP +#define ENGINE_SPRITEMODULE_HPP + +#include +#include +#include + +#include +#include "Rect.hpp" +#include "Color.hpp" + +namespace arcade{class ISpriteModule;} +namespace Polymorph +{ + class Vector2; + class GraphicalAPI; + + class SpriteModule + { + +///////////////////////////////// Constructors ///////////////////////////////// + public: + SpriteModule() = default; + explicit SpriteModule(std::string filePath); + explicit SpriteModule(std::shared_ptr &data); + ~SpriteModule(); +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + private: + std::string _filePath; + Rect _crop = {-1, -1, -1, -1}; + Color _color {0, 0, 0}; + + arcade::ISpriteModule *_spriteModule = nullptr; + + static inline std::vector _sprites; +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + public: + arcade::ISpriteModule *getSprite(); + void setSprite(const std::string& newFilePath); + void setPosition(Vector2 position); + void moveSprite(Vector2 move); + void setCrop(const Rect& crop); + void setColor(Color color); + + + + + private: + void _loadModule(); +///////////////////////////--------------------------/////////////////////////// + + friend GraphicalAPI; + + }; +} + +#endif //ENGINE_SPRITEMODULE_HPP diff --git a/include/GraphicalAPI/modules/TextModule.hpp b/include/GraphicalAPI/modules/TextModule.hpp new file mode 100644 index 00000000..9d780310 --- /dev/null +++ b/include/GraphicalAPI/modules/TextModule.hpp @@ -0,0 +1,75 @@ +/* +** EPITECH PROJECT, 2020 +** Text.hpp +** File description: +** header for Text.c +*/ + + +#pragma once + + +#include +#include "myxmlpp.hpp" +#include "Color.hpp" +#include "Vector.hpp" + +namespace arcade{class ITextModule;} + +namespace Polymorph +{ + class GraphicalAPI; + class TextModule + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + + public: + explicit TextModule(std::string fontPath, std::string , unsigned int size); + + explicit TextModule(std::shared_ptr &data); + + ~TextModule(); + TextModule &operator=(const std::string &newText); + TextModule &operator+=(const std::string &newText); + std::string operator+(const std::string &newText); + +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + + + private: + arcade::ITextModule *_textModule; + Color _color; + std::string _filepath; + std::string _str; + int _fontSize = -1; + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + arcade::ITextModule *getText(); + void setFont(std::string newFilePath); + void setFontSize(int size); + void setPosition(Vector2 position); + void move(Vector2 move); + void setString(std::string newString); + void setColor(Color color); + + + + private: + void _loadModule(); + + +//////////////////////--------------------------///////////////////////// + friend GraphicalAPI; + }; +} \ No newline at end of file diff --git a/include/Log/Logger.hpp b/include/Log/Logger.hpp new file mode 100644 index 00000000..8bcc250b --- /dev/null +++ b/include/Log/Logger.hpp @@ -0,0 +1,135 @@ +/* +** EPITECH PROJECT, 2020 +** Logger.hpp +** File description: +** header for Logger.c +*/ + +#ifndef ENGINE_LOGGER_HPP +#define ENGINE_LOGGER_HPP + +#include + +class Logger +{ + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + static inline std::string BLACK = "\033[0;30m"; // BLACK + static inline std::string RED = "\033[0;31m"; // RED + static inline std::string GREEN = "\033[0;32m"; // GREEN + static inline std::string YELLOW = "\033[0;33m"; // YELLOW + static inline std::string BLUE = "\033[0;34m"; // BLUE + static inline std::string PURPLE = "\033[0;35m"; // PURPLE + static inline std::string CYAN = "\033[0;36m"; // CYAN + static inline std::string WHITE = "\033[0;37m"; + static inline std::string RESET = "\033[0m"; + + enum severity { + DEBUG, + INFO, + MINOR, + MAJOR + }; + + enum Mode { + DEBUG_MODE, + RELEASE_MODE + }; + + private: + static inline std::string _logDir = "Logs/"; + static inline std::string _logInstance; + static inline std::string _engineLogFile = "engine.log"; + static inline Mode _mode = RELEASE_MODE; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + /** + * @details Overrides the default log directory of the Logger + * @param logDir new log directory + */ + static void setLogDir(const std::string& logDir); + + /** + * @details Adds a custom instance name prefix to the instance log sub directory + * @param logInstanceName prefix name + */ + static void setLogInstanceName(const std::string& logInstanceName); + + /** + * @details Inits the logger instance with a log subdirectory name by date time now and sets the program mode + * @param mode program logger mode (Release or Debug) + * @warning Default mode is RELEASE_MODE + */ + static void initLogInstance(Mode mode = RELEASE_MODE); + + /** + * @details Logs a message to file and console depending on program mode and severity + * @param message the message to log + * @param level the severity of the log (optional) + */ + static void log(const std::string& message, severity level = INFO); + + /** + * @details Logs a message to file and console depending on program mode and severity + * @param message the message to log + * @param specificFile a custom file to log in (will be placed in the log dir into the instance subdir log) + * @param level the severity of the log (optional) + */ + static void log(const std::string& message, std::string specificFile, severity level = INFO); + + + private: + + /** + * @details Logs a message and severity to console + * @param message the message to log + * @param level the severity of the log (optional) + */ + static void _consoleLog(const std::string& message, severity level); + + /** + * @details Logs a message and severity to default logfile instance + * @param message the message to log + * @param level the severity of the log (optional) + */ + static void _logFile(const std::string& message, severity level); + + /** + * @details Logs a message and severity to specified logfile + * @param message the message to log + * @param file the specific file to log in + * @param level the severity of the log (optional) + */ + static void _logFile(const std::string& message, const std::string& file, severity level); + + /** + * @details Gets and formats the actual date time to readable format + * @param flags format flags (refer to std::strftime documentation) + * @returns the formatted date time now string + */ + static std::string _getTimeNow(const std::string& flags); + + /** + * @details Convert's the severity enumeration to string + * @param level severity enum + * @returns the string corresponding to the severity + */ + static std::string _severity_to_string(severity level); + + /** + * @details Convert's the severity enumeration to ANSI color string + * @param level severity enum + * @returns the color corresponding to the severity + */ + static std::string _severity_to_color(severity level); +//////////////////////--------------------------///////////////////////// + +}; + + +#endif //ENGINE_LOGGER_HPP diff --git a/include/Polymorph/Components.hpp b/include/Polymorph/Components.hpp new file mode 100644 index 00000000..23036e9d --- /dev/null +++ b/include/Polymorph/Components.hpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2020 +** Components.hpp +** File description: +** header for Components.c +*/ + + +#pragma once + +#include "../Core/component/base/Component.hpp" + +#include "../Core/component/builtins/TransformComponent.hpp" + +// Drawables +#include "../Core/component/base/ADrawableComponent.hpp" +#include "../Core/component/builtins/drawables/SpriteRendererComponent.hpp" +#include "../Core/component/builtins/drawables/TextRendererComponent.hpp" + +// Colliders +#include "../Core/component/base/ACollider2d.hpp" +#include "../Core/component/builtins/colliders/ColliderCircle2d.hpp" +#include "../Core/component/builtins/colliders/ColliderRect2d.hpp" diff --git a/include/Polymorph/Config.hpp b/include/Polymorph/Config.hpp new file mode 100644 index 00000000..c4d6c4cb --- /dev/null +++ b/include/Polymorph/Config.hpp @@ -0,0 +1,14 @@ +/* +** EPITECH PROJECT, 2020 +** Config.hpp +** File description: +** header for Config.c +*/ + +#pragma once + +//TODO: Maybe find a way to not include some Debug parts in XmlComponent ? +#include "../Config/XmlComponent.hpp" +#include "../Config/XmlEntity.hpp" +#include "../Config/XmlScene.hpp" +#include "../Utilities/uuid.hpp" \ No newline at end of file diff --git a/include/Polymorph/Core.hpp b/include/Polymorph/Core.hpp new file mode 100644 index 00000000..e312280c --- /dev/null +++ b/include/Polymorph/Core.hpp @@ -0,0 +1,18 @@ +/* +** EPITECH PROJECT, 2020 +** Engine.hpp +** File description: +** header for Engine.c +*/ + + +#pragma once + +#include "../Core/Engine.hpp" +#include "../Core/scene/Scene.hpp" +#include "../Core/scene/SceneManager.hpp" +#include "../Core/entity/Entity_templated.hpp" +#include "../Core/component/base/Component_templated.hpp" +#include "../Utilities/safe_ptr.hpp" +#include "../GraphicalAPI/Input.hpp" +#include "../GraphicalAPI/GraphicalAPI.hpp" \ No newline at end of file diff --git a/include/Polymorph/Debug.hpp b/include/Polymorph/Debug.hpp new file mode 100644 index 00000000..a913ed49 --- /dev/null +++ b/include/Polymorph/Debug.hpp @@ -0,0 +1,13 @@ +/* +** EPITECH PROJECT, 2020 +** Exceptions.hpp +** File description: +** header for Exceptions.c +*/ + +#pragma once + +#include "../Exceptions/ExceptionLogger.hpp" +#include "../Exceptions/ConfigurationException.hpp" +#include "../Exceptions/GraphicalException.hpp" +#include "../Log/Logger.hpp" \ No newline at end of file diff --git a/include/Polymorph/Events.hpp b/include/Polymorph/Events.hpp new file mode 100644 index 00000000..a327e6cf --- /dev/null +++ b/include/Polymorph/Events.hpp @@ -0,0 +1,17 @@ +/* +** EPITECH PROJECT, 2020 +** BroadCasting.hpp +** File description: +** header for BroadCasting.c +*/ + +#ifndef ENGINE_EVENTS_HPP +#define ENGINE_EVENTS_HPP + +#include "../Events/ICollider2dHandler.hpp" +#include "../Events/IDragHandler.hpp" +#include "../Events/IDropHandler.hpp" +#include "../Events/IPointerClickHandler.hpp" +#include "../Events/IPointerHandler.hpp" + +#endif //ENGINE_EVENTS_HPP diff --git a/include/Polymorph/Factory.hpp b/include/Polymorph/Factory.hpp new file mode 100644 index 00000000..ab61a1d0 --- /dev/null +++ b/include/Polymorph/Factory.hpp @@ -0,0 +1,13 @@ +/* +** EPITECH PROJECT, 2020 +** Factory.hpp +** File description: +** header for Factory.c +*/ + +#pragma once + +#include "../ScriptingAPI/IScriptFactory.hpp" +#include "../ComponentsFactory/AComponentInitializer.hpp" +#include "../ComponentsFactory/ComponentFactory.hpp" + diff --git a/include/Polymorph/Settings.hpp b/include/Polymorph/Settings.hpp new file mode 100644 index 00000000..b065deb6 --- /dev/null +++ b/include/Polymorph/Settings.hpp @@ -0,0 +1,13 @@ +/* +** EPITECH PROJECT, 2020 +** Settings.hpp +** File description: +** header for Settings.c +*/ + +#pragma once + +#include "../GraphicalAPI/GraphicalAPI.hpp" +#include "../Core/settings/AudioSettings.hpp" +#include "../Core/settings/VideoSettings.hpp" +#include "../Core/settings/PhysicsSettings.hpp" \ No newline at end of file diff --git a/include/Polymorph/Types.hpp b/include/Polymorph/Types.hpp new file mode 100644 index 00000000..585f9e20 --- /dev/null +++ b/include/Polymorph/Types.hpp @@ -0,0 +1,18 @@ +/* +** EPITECH PROJECT, 2020 +** Types.hpp +** File description: +** header for Types.c +*/ + +#pragma once + +#include "../Utilities/Time.hpp" +#include "../Utilities/uuid.hpp" +#include "../Utilities/types/Vector.hpp" +#include "../Utilities/types/Rect.hpp" +#include "../Utilities/types/Circle.hpp" +#include "../Utilities/types/Color.hpp" +#include "../GraphicalAPI/modules/SpriteModule.hpp" +#include "../GraphicalAPI/modules/TextModule.hpp" +#include "../GraphicalAPI/modules/DisplayModule.hpp" diff --git a/include/ScriptingAPI/IScriptFactory.hpp b/include/ScriptingAPI/IScriptFactory.hpp new file mode 100644 index 00000000..129d31ea --- /dev/null +++ b/include/ScriptingAPI/IScriptFactory.hpp @@ -0,0 +1,39 @@ +/* +** EPITECH PROJECT, 2020 +** ScriptFactory +** File description: +** header for ScriptFactory.c +*/ + + +#pragma once + +namespace Polymorph +{ + class AComponentInitializer; + class IScriptFactory + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + virtual ~IScriptFactory() = default; + using Initializer = std::shared_ptr; + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + virtual Initializer create(std::string &type, Config::XmlComponent &data, Entity &entity) = 0; + + + private: + +//////////////////////--------------------------///////////////////////// + + }; +} + + + diff --git a/include/ScriptingAPI/ScriptingApi.hpp b/include/ScriptingAPI/ScriptingApi.hpp new file mode 100644 index 00000000..14f0190a --- /dev/null +++ b/include/ScriptingAPI/ScriptingApi.hpp @@ -0,0 +1,69 @@ +/* +** EPITECH PROJECT, 2020 +** ScriptingApi.hpp +** File description: +** header for ScriptingApi.c +*/ + + +#pragma once + +#include "DynamicLoader/DynamicLoader.hpp" + + +namespace Polymorph +{ + namespace Config{class XmlComponent;} + + class IScriptFactory; + class AComponentInitializer; + class Entity; + + + class ScriptingApi : public DynamicLibLoader + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + explicit ScriptingApi(std::string libPath); + + ~ScriptingApi(); + + +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + using Initializer = std::shared_ptr; + + private: + using ScriptFactoryLoader = IScriptFactory *(*)(); + using ScriptFactoryUnLoader = void (*)(IScriptFactory *); + ScriptFactoryLoader _loader = nullptr; + ScriptFactoryUnLoader _unloader = nullptr; + std::string _handlerPath; + IScriptFactory *_scriptFactory = nullptr; + static inline ScriptingApi *_instance = nullptr; + + +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + static Initializer create(std::string &type, Config::XmlComponent &data, Entity &entity); + + static void *getHandler(); + + private: + void _loadFactory(); + void _loadSymbols(); + + }; +} + + + diff --git a/include/Scripts/DummyScript.hpp b/include/Scripts/DummyScript.hpp deleted file mode 100644 index bd626457..00000000 --- a/include/Scripts/DummyScript.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* -** EPITECH PROJECT, 2020 -** DummyScript.hpp.h -** File description: -** header for DummyScript.c -*/ - -#ifndef ENGINE_DUMMYSCRIPT_HPP -#define ENGINE_DUMMYSCRIPT_HPP - -#include "Rect.hpp" -#include "Entity.hpp" -#include "default/TransformComponent.hpp" -#include "config/XmlComponent.hpp" -#include "Component.hpp" - -namespace Polymorph -{ - // @Serializable - class SerializableProperty - { - public: - SerializableProperty(Config::XmlNode *node) - { - - }; - GameObject object; - int rank; - }; - - class DummyScript : public Polymorph::Component - { - public: - int integerProperty; - float floatProperty; - bool BoolProperty; - std::string stringProperty; - Vector2 vector2Property; - Vector3 vector3Property; - Rect RectProperty; - GameObject gameObjectReferenceProperty; - Transform componentReferenceProperty; - SerializableProperty serializableProperty; - std::vector gameObjectListReferenceProperty; - - }; -} - - - -#endif //ENGINE_DUMMYSCRIPT_HPP diff --git a/include/Utilities/Time.hpp b/include/Utilities/Time.hpp new file mode 100644 index 00000000..6df6332b --- /dev/null +++ b/include/Utilities/Time.hpp @@ -0,0 +1,76 @@ +/* +** EPITECH PROJECT, 2020 +** Time.hpp.h +** File description: +** header for Time.c +*/ + +#ifndef ENGINE_TIME_HPP +#define ENGINE_TIME_HPP + +#include +#include + +namespace Polymorph +{ + class Time + { + using Clock = std::chrono::steady_clock; + using Duration = std::chrono::time_point; + +///////////////////////////////// Constructors ///////////////////////////////// + + public: + /** + * @details Create a Time clock by initializing internal properties + */ + explicit Time(); +///////////////////////////--------------------------/////////////////////////// +///////////////////////////// PROPERTIES //////////////////////////////// + public: + static inline double deltaTime = 0.0f; + + private: + Duration _lastTime; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + void computeDeltaTime(); +//////////////////////--------------------------///////////////////////// + + }; + + + + class Timer + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + Timer() = default; + explicit Timer(double delay); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + double delay = 0; + double actual = 0; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + void tick(); + bool timeIsUp(bool isReset = true);; +//////////////////////--------------------------///////////////////////// + + }; + +} + +#endif //ENGINE_TIME_HPP diff --git a/include/Engine/Utilities/safe_ptr.hpp b/include/Utilities/safe_ptr.hpp similarity index 70% rename from include/Engine/Utilities/safe_ptr.hpp rename to include/Utilities/safe_ptr.hpp index 8198a0d7..e534d2ae 100644 --- a/include/Engine/Utilities/safe_ptr.hpp +++ b/include/Utilities/safe_ptr.hpp @@ -30,9 +30,17 @@ namespace Polymorph return this->lock(); } + T *operator->() + { + if (this->expired() || this->lock() == nullptr) + throw std::runtime_error("Object reference not set to an instance"); + return this->lock().get(); + } + + bool operator!() { - return this->expired(); + return this->expired() || this->lock() == nullptr; } }; diff --git a/include/Utilities/types/Circle.hpp b/include/Utilities/types/Circle.hpp new file mode 100644 index 00000000..28d8cf0a --- /dev/null +++ b/include/Utilities/types/Circle.hpp @@ -0,0 +1,61 @@ +/* +** EPITECH PROJECT, 2020 +** Circle.hpp +** File description: +** header for Circle.c +*/ + +#ifndef ENGINE_CIRCLE_HPP +#define ENGINE_CIRCLE_HPP + +#include "Vector.hpp" + +namespace Polymorph +{ + class Rect; + + class Circle + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + + Circle(const Vector2 ¢er, float radius); + Circle(const Circle &circle); + Circle(float x, float y, float radius); + ~Circle() = default; +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + Vector2 center; + float radius; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + public: + static bool intersect(const Circle &circle1, const Circle &circle2); + static bool intersect(const Circle &circle, const Vector2 ¢er, float radius); + static bool intersect(const Vector2 ¢er, float radius, const Circle &circle); + static bool intersect(const Vector2 ¢er1, float radius1, const Vector2 ¢er2, float radius2); + + static bool intersect(const Rect &rect, const Circle &circle); + static bool intersect(const Vector2 &position, const Vector2 &size, const Circle &circle); + static bool intersect(const Vector2 &position, const Vector2 &size, const Vector2 ¢er, float radius); + static bool intersect(const Rect &rect, const Vector2 ¢er, float radius); + static bool intersect(const Circle &circle, const Rect &rect); + static bool intersect(const Circle &circle, const Vector2 &position, const Vector2 &size); + static bool intersect(const Vector2 ¢er, float radius, const Vector2 &position, const Vector2 &size); + static bool intersect(const Vector2 ¢er, float radius, const Rect &rect); +//////////////////////--------------------------///////////////////////// + + }; + +} + + +#endif //ENGINE_CIRCLE_HPP diff --git a/include/Utilities/types/Color.hpp b/include/Utilities/types/Color.hpp new file mode 100644 index 00000000..bd4d1ac0 --- /dev/null +++ b/include/Utilities/types/Color.hpp @@ -0,0 +1,48 @@ +/* +** EPITECH PROJECT, 2020 +** Color.hpp +** File description: +** header for Color.c +*/ + +#ifndef ENGINE_COLOR_HPP +#define ENGINE_COLOR_HPP + +#include + +namespace Polymorph +{ + class Color + { +///////////////////////////////// Constructors ///////////////////////////////// + public: + Color() = default; + + explicit Color(std::shared_ptr &data); + explicit Color(unsigned char r, unsigned char g, unsigned char b); + ~Color() = default; +///////////////////////////--------------------------/////////////////////////// + + + +///////////////////////////////// Properties /////////////////////////////////// + public: + unsigned char r; + unsigned char g; + unsigned char b; + +///////////////////////////--------------------------/////////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + public: + void setColor(unsigned char r, unsigned char g, unsigned char b); + +///////////////////////////--------------------------/////////////////////////// + + }; + +} + +#endif //ENGINE_COLOR_HPP diff --git a/include/Utilities/types/Rect.hpp b/include/Utilities/types/Rect.hpp new file mode 100644 index 00000000..81780f52 --- /dev/null +++ b/include/Utilities/types/Rect.hpp @@ -0,0 +1,73 @@ +/* +** EPITECH PROJECT, 2020 +** Rect.hpp.h +** File description: +** header for Rect.c +*/ + +#ifndef ENGINE_RECT_HPP +#define ENGINE_RECT_HPP + +#include "Vector.hpp" + +namespace Polymorph +{ + class Circle; + class Rect + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + Rect(float x, float y, float w, float h) + : x(x), y(y), width(w), height(h){}; + + Rect(Vector2 &position, float w, float h) + : x(position.x), y(position.y), width(w), height(h){}; + + Rect(Vector2 &position, Vector2 &size) + : x(position.x), y(position.y), width(size.x), height(size.y){}; + + Rect(float x, float y, Vector2 &size) + : x(x), y(y), width(size.x), height(size.y){}; + ~Rect() = default; + + Rect(Rect ©) = default;; + + Rect(): x(0), y(0), width(0), height(0){}; +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + float x; + float y; + float width; + float height; + static Rect Zero; +//////////////////////--------------------------///////////////////////// + + + +////////////////////////////////// Methods ///////////////////////////////////// + + public: + static bool intersect(const Rect &rect1, const Rect &rect2); + static bool intersect(const Vector2 &position, const Vector2 &size, const Rect &rect); + static bool intersect(const Rect &rect, const Vector2 &position, const Vector2 &size); + static bool intersect(const Vector2 &position1, const Vector2 &size1, const Vector2 &position2, const Vector2 &size2); + + static bool intersect(const Rect &rect, const Circle &circle); + static bool intersect(const Vector2 &position, const Vector2 &size, const Circle &circle); + static bool intersect(const Vector2 &position, const Vector2 &size, const Vector2 ¢er, float radius); + static bool intersect(const Rect &rect, const Vector2 ¢er, float radius); + static bool intersect(const Circle &circle, const Rect &rect); + static bool intersect(const Circle &circle, const Vector2 &position, const Vector2 &size); + static bool intersect(const Vector2 ¢er, float radius, const Vector2 &position, const Vector2 &size); + static bool intersect(const Vector2 ¢er, float radius, const Rect &rect); + +//////////////////////--------------------------///////////////////////// + + }; +} + + +#endif //ENGINE_RECT_HPP diff --git a/include/Utilities/types/Vector.hpp b/include/Utilities/types/Vector.hpp new file mode 100644 index 00000000..259a33ce --- /dev/null +++ b/include/Utilities/types/Vector.hpp @@ -0,0 +1,90 @@ +/* +** EPITECH PROJECT, 2020 +** Vector2.hpp.h +** File description: +** header for Vector2.c +*/ + +#ifndef ENGINE_VECTOR_HPP +#define ENGINE_VECTOR_HPP + + +namespace Polymorph +{ + class Vector2; + class Vector3; + + class Vector3 + { +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + Vector3(); + ~Vector3() = default; + Vector3(float x, float y); + Vector3(float x, float y, float z); + Vector3(const Vector3 ©) = default; + explicit Vector3(const Vector2 ©); +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + float x; + float y; + float z; + static Vector3 Zero; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + Vector3 operator+(Vector2 &other) const; + Vector3 operator+(const Vector3 &other) const; + Vector3 &operator+=(const Vector3 &other); + Vector3 operator-(const Vector3 &other) const; + Vector3 &operator-=(const Vector3 &other); + bool operator==(const Vector3 &other) const; + bool operator!=(const Vector3 &other) const; +//////////////////////--------------------------///////////////////////// + + }; + + + + class Vector2 + { + +////////////////////// CONSTRUCTORS/DESTRUCTORS ///////////////////////// + public: + Vector2(float x, float y); + Vector2(const Vector2 ©) = default; + explicit Vector2(const Vector3 ©); + Vector2(); + ~Vector2() = default; +//////////////////////--------------------------///////////////////////// + + + +///////////////////////////// PROPERTIES //////////////////////////////// + public: + float x; + float y; + static Vector2 Zero; +//////////////////////--------------------------///////////////////////// + + + +/////////////////////////////// METHODS ///////////////////////////////// + Vector2 delta(const Vector2 &other) const; + Vector2 operator+(const Vector2 &other) const; + Vector2 &operator+=(const Vector2 &other); + Vector2 operator-(const Vector2 &other) const; + Vector2 &operator-=(const Vector2 &other); + bool operator==(const Vector2 &other) const; +//////////////////////--------------------------///////////////////////// + + }; +} + +#endif //ENGINE_VECTOR_HPP diff --git a/include/Utilities/uuid.hpp b/include/Utilities/uuid.hpp new file mode 100644 index 00000000..3516eedf --- /dev/null +++ b/include/Utilities/uuid.hpp @@ -0,0 +1,25 @@ +/* +** EPITECH PROJECT, 2020 +** Uuid.hpp +** File description: +** header for Uuid.c +*/ + +#ifndef ENGINE_UUID_HPP +#define ENGINE_UUID_HPP + +#include +#include + +namespace Polymorph { + namespace uuid { + static inline std::random_device rd; + static inline std::mt19937 gen(rd()); + static inline std::uniform_int_distribution<> dis(0, 15); + + std::string uuid(); + } +} + + +#endif //ENGINE_UUID_HPP diff --git a/lib/myxmlpp/.github/workflows/publishToPages.yml b/lib/myxmlpp/.github/workflows/publishToPages.yml new file mode 100644 index 00000000..0670c5ad --- /dev/null +++ b/lib/myxmlpp/.github/workflows/publishToPages.yml @@ -0,0 +1,20 @@ +name: Generate doc +on: + push: + branches: + - master + +jobs: + run-doxygen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Doxygen Action + uses: mattnotmitt/doxygen-action@1.9.3 + + - name: Deploy doc to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doxygen/html diff --git a/lib/myxmlpp/.github/workflows/runTests.yml b/lib/myxmlpp/.github/workflows/runTests.yml new file mode 100644 index 00000000..0e49b0e3 --- /dev/null +++ b/lib/myxmlpp/.github/workflows/runTests.yml @@ -0,0 +1,36 @@ +name: Run tests +on: + pull_request: + branches: + - master + - dev + +jobs: + run-tests: + runs-on: ubuntu-latest + container: + image: alexjub94/updated-criterion + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: mkdir build folder + run: mkdir -p build + + - name: cmake build + run: cmake -Bbuild -H. + + - name: build unit test + run: cmake --build build --target unit-tests --parallel 2 + + - name: run tests + run: ./unit-tests --json=tests_report.json || echo "" + + - name: interpret-criterion-action + uses: alexjub94/interpret-criterion-action@v2.0.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + reportFilepath: tests_report.json + + diff --git a/lib/myxmlpp/.gitignore b/lib/myxmlpp/.gitignore new file mode 100644 index 00000000..905d6e67 --- /dev/null +++ b/lib/myxmlpp/.gitignore @@ -0,0 +1,46 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +docs/doxygen/** +build* +myxmlppexec +unit-tests + +# Default ignored files +.idea/shelf/ +.idea/workspace.xml +# Editor-based HTTP Client requests +.idea/httpRequests/ +# Datasource local storage ignored files +.idea/dataSources/ +.idea/dataSources.local.xml \ No newline at end of file diff --git a/lib/myxmlpp/.gitmodules b/lib/myxmlpp/.gitmodules new file mode 100644 index 00000000..10beb965 --- /dev/null +++ b/lib/myxmlpp/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/doxygen-awesome-css"] + path = docs/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css.git diff --git a/lib/myxmlpp/.idea/.gitignore b/lib/myxmlpp/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/lib/myxmlpp/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/lib/myxmlpp/.idea/cmake.xml b/lib/myxmlpp/.idea/cmake.xml new file mode 100644 index 00000000..f4bf2749 --- /dev/null +++ b/lib/myxmlpp/.idea/cmake.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/lib/myxmlpp/.idea/misc.xml b/lib/myxmlpp/.idea/misc.xml new file mode 100644 index 00000000..79b3c948 --- /dev/null +++ b/lib/myxmlpp/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/lib/myxmlpp/.idea/modules.xml b/lib/myxmlpp/.idea/modules.xml new file mode 100644 index 00000000..457feec1 --- /dev/null +++ b/lib/myxmlpp/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/lib/myxmlpp/.idea/myxmlpp.iml b/lib/myxmlpp/.idea/myxmlpp.iml new file mode 100644 index 00000000..f08604bb --- /dev/null +++ b/lib/myxmlpp/.idea/myxmlpp.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/lib/myxmlpp/.idea/vcs.xml b/lib/myxmlpp/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/lib/myxmlpp/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lib/myxmlpp/CMakeLists.txt b/lib/myxmlpp/CMakeLists.txt new file mode 100644 index 00000000..a7fe1e4b --- /dev/null +++ b/lib/myxmlpp/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.17) +project(myxmlpp) + +set(CMAKE_CXX_STANDARD 20) +set(LIBRARY_OUTPUT_PATH ../) +set(EXECUTABLE_OUTPUT_PATH ../) + +file(GLOB_RECURSE SRCS src/*.cpp) +file(GLOB_RECURSE UNIT_TESTS_SRCS tests/unit-testing/*.cpp) +file(GLOB_RECURSE INCS myxmlpp/*.hpp) + +include_directories(include) +include_directories(include/exceptions) + +add_library(myxmlpp ${SRCS} ${INCS}) + +add_executable(myxmlppexec EXCLUDE_FROM_ALL tests/test.cpp) +target_link_directories(myxmlppexec PUBLIC myxmlpp) +target_link_libraries(myxmlppexec myxmlpp) + +add_executable(unit-tests EXCLUDE_FROM_ALL ${UNIT_TESTS_SRCS}) +target_link_libraries(unit-tests criterion) +target_link_directories(unit-tests PUBLIC myxmlpp) +target_link_libraries(unit-tests myxmlpp) diff --git a/lib/myxmlpp/Doxyfile b/lib/myxmlpp/Doxyfile new file mode 100644 index 00000000..088e1e73 --- /dev/null +++ b/lib/myxmlpp/Doxyfile @@ -0,0 +1,2638 @@ +# Doxyfile 1.9.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "myxmlpp" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = . + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = docs build build-debug + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css docs/doxygen-awesome-css/doxygen-awesome-sidebar-only.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATOR_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /