-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from EldarMuradov/release-0.0.1
Release 0.0.1
- Loading branch information
Showing
566 changed files
with
154,649 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/core/src/core/system.cpp → modules/core/src/core/system_info.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "ecs/base_components/base_components.h" | ||
|
||
namespace era_engine | ||
{ | ||
|
||
NameComponent::NameComponent(ref<Entity::EcsData> _data, const char* n) : Component(_data) | ||
{ | ||
strncpy(name, n, sizeof(name)); | ||
name[sizeof(name) - 1] = 0; | ||
} | ||
|
||
NameComponent::~NameComponent() | ||
{ | ||
} | ||
|
||
TransformComponent::TransformComponent(ref<Entity::EcsData> _data, const trs& t) | ||
: Component(_data), transform(t) | ||
{ | ||
} | ||
|
||
TransformComponent::TransformComponent(ref<Entity::EcsData> _data, vec3 position, quat rotation, vec3 scale) | ||
: Component(_data), transform(position, rotation, scale) | ||
{ | ||
} | ||
|
||
TransformComponent::~TransformComponent() | ||
{ | ||
} | ||
|
||
ChildComponent::ChildComponent(ref<Entity::EcsData> _data, weakref<Entity::EcsData> _parent) | ||
: Component(_data), parent(_parent) | ||
{ | ||
} | ||
|
||
ChildComponent::~ChildComponent() | ||
{ | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include "core/math.h" | ||
|
||
#include "ecs/component.h" | ||
|
||
namespace era_engine | ||
{ | ||
class NameComponent final : Component | ||
{ | ||
public: | ||
NameComponent(ref<Entity::EcsData> _data, const char* n = "Component"); | ||
|
||
virtual ~NameComponent(); | ||
|
||
public: | ||
char name[32]{}; | ||
}; | ||
REFLECT_STRUCT(NameComponent, | ||
(name, "name") | ||
); | ||
|
||
class TransformComponent final : Component | ||
{ | ||
public: | ||
TransformComponent(ref<Entity::EcsData> _data, const trs& t = trs::identity); | ||
TransformComponent(ref<Entity::EcsData> _data, vec3 position, quat rotation, vec3 scale = vec3(1.f, 1.f, 1.f)); | ||
|
||
virtual ~TransformComponent(); | ||
|
||
trs transform = trs::identity; | ||
}; | ||
REFLECT_STRUCT(TransformComponent, | ||
(transform, "transform") | ||
); | ||
|
||
class ChildComponent final : Component | ||
{ | ||
public: | ||
ChildComponent(ref<Entity::EcsData> _data, weakref<Entity::EcsData> _parent); | ||
virtual ~ChildComponent(); | ||
|
||
weakref<Entity::EcsData> parent; | ||
}; | ||
REFLECT_STRUCT(ChildComponent, | ||
(parent, "parent") | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "ecs/component.h" | ||
#include "ecs/world.h" | ||
|
||
namespace era_engine | ||
{ | ||
|
||
RTTR_REGISTRATION | ||
{ | ||
using namespace rttr; | ||
rttr::registration::class_<Component>("Component") | ||
.constructor<>(); | ||
} | ||
|
||
Component::Component(ref<Entity::EcsData> _data) noexcept | ||
: component_data(_data) | ||
{ | ||
} | ||
|
||
Component::Component(const Component& _component) noexcept | ||
: component_data(_component.component_data) | ||
{ | ||
} | ||
|
||
Component::Component(Component&& _component) noexcept | ||
{ | ||
component_data = std::move(_component.component_data); | ||
} | ||
|
||
Component::~Component() | ||
{ | ||
} | ||
|
||
Component& Component::operator=(const Component& _component) | ||
{ | ||
component_data = _component.component_data; | ||
return *this; | ||
} | ||
|
||
Component& Component::operator=(Component&& _component) | ||
{ | ||
component_data = std::move(_component.component_data); | ||
return *this; | ||
} | ||
|
||
World* Component::get_world() const | ||
{ | ||
return worlds[component_data->registry]; | ||
} | ||
|
||
Entity Component::get_entity() const | ||
{ | ||
return Entity(component_data); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include "core/reflect.h" | ||
|
||
#include "ecs/entity.h" | ||
|
||
#include <typeinfo> | ||
|
||
#include <rttr/type> | ||
#include <rttr/registration> | ||
#include <rttr/registration_friend> | ||
|
||
namespace era_engine | ||
{ | ||
using namespace rttr; | ||
class World; | ||
|
||
class Component | ||
{ | ||
public: | ||
Component() = default; | ||
Component(ref<Entity::EcsData> _data) noexcept; | ||
Component(const Component& _component) noexcept; | ||
Component(Component&& _component) noexcept; | ||
virtual ~Component(); | ||
|
||
Component& operator=(const Component& _component); | ||
Component& operator=(Component&& _component); | ||
|
||
World* get_world() const; | ||
|
||
Entity get_entity() const; | ||
|
||
RTTR_ENABLE() | ||
RTTR_REGISTRATION_FRIEND | ||
|
||
protected: | ||
ref<Entity::EcsData> component_data = nullptr; | ||
}; | ||
} |
Oops, something went wrong.