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
-
-
- 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