Ajout du schéma JSON pour lecture de scènes + ajout des composants son avec OpenAL + composants scripts et libraire de script + ajout de librairies pour le son dr_libs et openAL + librairie schéma json validator + correctifs divers d'oubli et autres + entity et components factory fonctionnelles + rework API graphique et systèmes mergés dans Systèmes (audio physique, etc...) + rework sauvegarde des resources de façon unique pour éviter les reload (correctifs associés)
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
#define CENTITY_HPP
|
||||
|
||||
#include <forward_list>
|
||||
#include <memory>
|
||||
#include "../Utils/CSerializable.hpp"
|
||||
#include "../Systems/EntityComponentManager.hpp"
|
||||
#include <functional>
|
||||
#include "../../Utils/JsonParser/CSerializable.hpp"
|
||||
#include "EntityComponentManager.hpp"
|
||||
|
||||
namespace CosmicCore
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace CosmicCore
|
||||
*/
|
||||
CScene* m_scene;
|
||||
|
||||
EntityComponentManager& m_registryReference;
|
||||
std::reference_wrapper<EntityComponentManager> m_registryReference;
|
||||
|
||||
EntityId m_handle;
|
||||
|
||||
@@ -30,9 +30,11 @@ namespace CosmicCore
|
||||
*/
|
||||
CEntity() = delete;
|
||||
|
||||
CEntity(EntityComponentManager& registry, EntityId handle, CScene* scene);
|
||||
CEntity(std::reference_wrapper<EntityComponentManager> registry, EntityId handle, CScene* scene);
|
||||
|
||||
CEntity(const CEntity& cop);
|
||||
|
||||
CEntity& operator=(const CEntity& ent);
|
||||
/**
|
||||
* @brief CEntity's destructor.
|
||||
*/
|
||||
@@ -42,7 +44,7 @@ namespace CosmicCore
|
||||
* @brief Getter to the parent entity.
|
||||
* @return a pointer to the parent entity m_parent. nullptr if there is not.
|
||||
*/
|
||||
CEntity getParent();
|
||||
//CEntity getParent();
|
||||
|
||||
template<typename compType, typename... Args>
|
||||
void addComponent(std::forward_list<Args...> args)
|
||||
@@ -57,7 +59,10 @@ namespace CosmicCore
|
||||
}
|
||||
|
||||
EntityComponentManager& getRegistry(){return m_registryReference;};
|
||||
const EntityComponentManager& getRegistry() const {return m_registryReference;};
|
||||
|
||||
EntityId getHandle(){return m_handle;};
|
||||
|
||||
/**
|
||||
* @brief Getter to the entity's scene.
|
||||
* @return The pointer m_scene.
|
||||
@@ -73,7 +78,10 @@ namespace CosmicCore
|
||||
EntityId operator*(){
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
|
||||
const EntityId operator*() const {
|
||||
return m_handle;
|
||||
}
|
||||
//TODO GET COMPONENT VECTOR OF SPECIFIC TYPE ? si utile
|
||||
|
||||
nlohmann::json to_json();
|
||||
|
||||
Reference in New Issue
Block a user