diff --git a/CMakeLists.txt b/CMakeLists.txt index 9db9ebf..65d1144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR) -project(UECS VERSION 0.9.7) +project(UECS VERSION 0.9.8) message(STATUS "[Project] ${PROJECT_NAME}") include(cmake/InitUCMake.cmake) diff --git a/include/UECS/CmptPtr.h b/include/UECS/CmptPtr.h index 9ac908d..13598ea 100644 --- a/include/UECS/CmptPtr.h +++ b/include/UECS/CmptPtr.h @@ -4,7 +4,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { // CmptType + void* class CmptPtr { public: diff --git a/include/UECS/CmptTag.h b/include/UECS/CmptTag.h index 06a4f59..c5c8545 100644 --- a/include/UECS/CmptTag.h +++ b/include/UECS/CmptTag.h @@ -2,7 +2,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { namespace CmptTag { // LastFrame -> Write -> Latest diff --git a/include/UECS/CmptType.h b/include/UECS/CmptType.h index fa00a21..aac069e 100644 --- a/include/UECS/CmptType.h +++ b/include/UECS/CmptType.h @@ -2,7 +2,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { // Component Type // use a hashcode to distinguish different type class CmptType { diff --git a/include/UECS/Entity.h b/include/UECS/Entity.h index f4696e7..fc94a24 100644 --- a/include/UECS/Entity.h +++ b/include/UECS/Entity.h @@ -2,7 +2,7 @@ #include "detail/Util.h" -namespace Ubpa { +namespace Ubpa::UECS { // index + version class Entity { public: diff --git a/include/UECS/EntityFilter.h b/include/UECS/EntityFilter.h index 7c5776a..1b0db51 100644 --- a/include/UECS/EntityFilter.h +++ b/include/UECS/EntityFilter.h @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { // filter Archetype with All, Any and None class EntityFilter { public: diff --git a/include/UECS/EntityLocator.h b/include/UECS/EntityLocator.h index cb50a2e..3ae4237 100644 --- a/include/UECS/EntityLocator.h +++ b/include/UECS/EntityLocator.h @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { // locate components in function's argument list for Archetype class EntityLocator { public: diff --git a/include/UECS/EntityMngr.h b/include/UECS/EntityMngr.h index f524317..cff230d 100644 --- a/include/UECS/EntityMngr.h +++ b/include/UECS/EntityMngr.h @@ -9,7 +9,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class World; class IListener; diff --git a/include/UECS/EntityQuery.h b/include/UECS/EntityQuery.h index 574e7f1..dc91465 100644 --- a/include/UECS/EntityQuery.h +++ b/include/UECS/EntityQuery.h @@ -3,7 +3,7 @@ #include "EntityFilter.h" #include "EntityLocator.h" -namespace Ubpa { +namespace Ubpa::UECS { // EntityFilter + EntityLocator class EntityQuery { public: diff --git a/include/UECS/IListener.h b/include/UECS/IListener.h index 3c9598c..25edca1 100644 --- a/include/UECS/IListener.h +++ b/include/UECS/IListener.h @@ -2,7 +2,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class World; class SystemMngr; class EntityMngr; diff --git a/include/UECS/RTDCmptTraits.h b/include/UECS/RTDCmptTraits.h index d925d3f..b38bf2a 100644 --- a/include/UECS/RTDCmptTraits.h +++ b/include/UECS/RTDCmptTraits.h @@ -5,7 +5,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { // run-time dynamic component traits, singleton // size (> 0) is neccessary // optional diff --git a/include/UECS/RTDCmptsView.h b/include/UECS/RTDCmptsView.h index 7c17f4b..9ad2aec 100644 --- a/include/UECS/RTDCmptsView.h +++ b/include/UECS/RTDCmptsView.h @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class EntityLocator; // use RTDCmptsView::Iterator to read CmptPtr diff --git a/include/UECS/Schedule.h b/include/UECS/Schedule.h index 342cbaa..c0ba265 100644 --- a/include/UECS/Schedule.h +++ b/include/UECS/Schedule.h @@ -8,11 +8,11 @@ #include -namespace Ubpa::detail::Schedule_ { +namespace Ubpa::UECS::detail::Schedule_ { struct Compiler; } -namespace Ubpa { +namespace Ubpa::UECS { class EntityMngr; class SystemMngr; diff --git a/include/UECS/SystemFunc.h b/include/UECS/SystemFunc.h index de061d7..c2806ce 100644 --- a/include/UECS/SystemFunc.h +++ b/include/UECS/SystemFunc.h @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { // [description] // system function registered by Schedule in ::OnUpdate(Schedule&) // name + query + function<...> diff --git a/include/UECS/SystemMngr.h b/include/UECS/SystemMngr.h index 4d2b2ce..43dd9ef 100644 --- a/include/UECS/SystemMngr.h +++ b/include/UECS/SystemMngr.h @@ -4,7 +4,7 @@ #include -namespace Ubpa{ +namespace Ubpa::UECS{ class IListener; // System Manager diff --git a/include/UECS/World.h b/include/UECS/World.h index dc6c1a2..7de9be4 100644 --- a/include/UECS/World.h +++ b/include/UECS/World.h @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class IListener; // SystemMngr + EntityMngr diff --git a/include/UECS/detail/Archetype.h b/include/UECS/detail/Archetype.h index b5ead3d..b5f3e6d 100644 --- a/include/UECS/detail/Archetype.h +++ b/include/UECS/detail/Archetype.h @@ -14,7 +14,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class EntityMngr; // Entity is a special Component diff --git a/include/UECS/detail/Archetype.inl b/include/UECS/detail/Archetype.inl index b44225e..64b8740 100644 --- a/include/UECS/detail/Archetype.inl +++ b/include/UECS/detail/Archetype.inl @@ -2,7 +2,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { template Archetype::Archetype(TypeList) : types(TypeList{}) diff --git a/include/UECS/detail/Chunk.h b/include/UECS/detail/Chunk.h index 8f791df..697a1f8 100644 --- a/include/UECS/detail/Chunk.h +++ b/include/UECS/detail/Chunk.h @@ -5,7 +5,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { using byte = uint8_t; static_assert(sizeof(byte) == 1); struct alignas(128) Chunk { diff --git a/include/UECS/detail/CmptTag.inl b/include/UECS/detail/CmptTag.inl index 810a7fd..6e65293 100644 --- a/include/UECS/detail/CmptTag.inl +++ b/include/UECS/detail/CmptTag.inl @@ -2,12 +2,12 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class Entity; class EntityLocator; } -namespace Ubpa::CmptTag { +namespace Ubpa::UECS::CmptTag { template struct RemoveTag : IType {}; template struct RemoveTag : IType {}; template struct RemoveTag> : IType {}; diff --git a/include/UECS/detail/CmptType.inl b/include/UECS/detail/CmptType.inl index 2a270cb..89d542b 100644 --- a/include/UECS/detail/CmptType.inl +++ b/include/UECS/detail/CmptType.inl @@ -5,8 +5,8 @@ namespace std { struct hash; template<> - struct hash { - constexpr size_t operator()(const Ubpa::CmptType& t) const noexcept { + struct hash { + constexpr size_t operator()(const Ubpa::UECS::CmptType& t) const noexcept { return t.HashCode(); } }; diff --git a/include/UECS/detail/CmptTypeSet.h b/include/UECS/detail/CmptTypeSet.h index 02a2d59..d82f2f5 100644 --- a/include/UECS/detail/CmptTypeSet.h +++ b/include/UECS/detail/CmptTypeSet.h @@ -8,7 +8,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { class CmptTypeSet : std::set { public: CmptTypeSet() : hashcode{ TypeID } {} diff --git a/include/UECS/detail/CmptTypeSet.inl b/include/UECS/detail/CmptTypeSet.inl index 1e94021..eee9c6d 100644 --- a/include/UECS/detail/CmptTypeSet.inl +++ b/include/UECS/detail/CmptTypeSet.inl @@ -1,6 +1,6 @@ #pragma once -namespace Ubpa { +namespace Ubpa::UECS { inline CmptTypeSet::CmptTypeSet(const CmptType* types, size_t num) { assert(types != nullptr && num != 0); for (size_t i = 0; i < num; i++) @@ -106,8 +106,8 @@ namespace Ubpa { namespace std { template<> - struct hash { - size_t operator()(const Ubpa::CmptTypeSet& types) const noexcept { + struct hash { + size_t operator()(const Ubpa::UECS::CmptTypeSet& types) const noexcept { return types.HashCode(); } }; diff --git a/include/UECS/detail/EntityFilter.inl b/include/UECS/detail/EntityFilter.inl index 0a362f8..42880d5 100644 --- a/include/UECS/detail/EntityFilter.inl +++ b/include/UECS/detail/EntityFilter.inl @@ -2,7 +2,7 @@ #include "Util.h" -namespace Ubpa { +namespace Ubpa::UECS { template EntityFilter::EntityFilter(TypeList, TypeList, TypeList) : allCmptTypes{ CmptType::Of... }, @@ -125,8 +125,8 @@ namespace std { template struct hash; template<> - struct hash { - size_t operator()(const Ubpa::EntityFilter& filter) const noexcept { + struct hash { + size_t operator()(const Ubpa::UECS::EntityFilter& filter) const noexcept { return filter.HashCode(); } }; diff --git a/include/UECS/detail/EntityLocator.inl b/include/UECS/detail/EntityLocator.inl index 7a98a1a..d4a1f7d 100644 --- a/include/UECS/detail/EntityLocator.inl +++ b/include/UECS/detail/EntityLocator.inl @@ -6,7 +6,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { template EntityLocator::EntityLocator(TaggedCmptList) : EntityLocator{ Filter_t{}, diff --git a/include/UECS/detail/EntityMngr.inl b/include/UECS/detail/EntityMngr.inl index fa413e9..76d4006 100644 --- a/include/UECS/detail/EntityMngr.inl +++ b/include/UECS/detail/EntityMngr.inl @@ -5,7 +5,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { template Archetype* EntityMngr::GetOrCreateArchetypeOf() { static_assert(IsSet_v>, diff --git a/include/UECS/detail/EntityQuery.inl b/include/UECS/detail/EntityQuery.inl index 2df9a05..b78aa0d 100644 --- a/include/UECS/detail/EntityQuery.inl +++ b/include/UECS/detail/EntityQuery.inl @@ -1,6 +1,6 @@ #pragma once -namespace Ubpa { +namespace Ubpa::UECS { template EntityQuery::EntityQuery(TypeList, TypeList, TypeList, TypeList) : filter{ TypeList{}, TypeList{}, TypeList{} }, @@ -13,8 +13,8 @@ namespace std { template struct hash; template<> - struct hash { - size_t operator()(const Ubpa::EntityQuery& query) const noexcept { + struct hash { + size_t operator()(const Ubpa::UECS::EntityQuery& query) const noexcept { return query.HashCode(); } }; diff --git a/include/UECS/detail/Job.h b/include/UECS/detail/Job.h index 8a2b19c..2c22773 100644 --- a/include/UECS/detail/Job.h +++ b/include/UECS/detail/Job.h @@ -2,7 +2,7 @@ #include "_deps/taskflow/taskflow.hpp" -namespace Ubpa { +namespace Ubpa::UECS { using Job = tf::Taskflow; using JobHandle = tf::Task; diff --git a/include/UECS/detail/RTDCmptTraits.inl b/include/UECS/detail/RTDCmptTraits.inl index e8b5825..f6dc769 100644 --- a/include/UECS/detail/RTDCmptTraits.inl +++ b/include/UECS/detail/RTDCmptTraits.inl @@ -2,7 +2,7 @@ #include "../RTDCmptTraits.h" -namespace Ubpa { +namespace Ubpa::UECS { inline RTDCmptTraits& RTDCmptTraits::Instance() noexcept { static RTDCmptTraits instance; return instance; diff --git a/include/UECS/detail/RTSCmptTraits.h b/include/UECS/detail/RTSCmptTraits.h index e11ae29..fde4557 100644 --- a/include/UECS/detail/RTSCmptTraits.h +++ b/include/UECS/detail/RTSCmptTraits.h @@ -5,7 +5,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { // run-time static component traits class RTSCmptTraits { public: diff --git a/include/UECS/detail/RTSCmptTraits.inl b/include/UECS/detail/RTSCmptTraits.inl index 33159a1..8c3a0ae 100644 --- a/include/UECS/detail/RTSCmptTraits.inl +++ b/include/UECS/detail/RTSCmptTraits.inl @@ -4,7 +4,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { inline size_t RTSCmptTraits::Sizeof(CmptType type) const { assert(sizeofs.find(type) != sizeofs.end()); return sizeofs.find(type)->second; diff --git a/include/UECS/detail/Schedule.inl b/include/UECS/detail/Schedule.inl index 43ed7b2..ed1f056 100644 --- a/include/UECS/detail/Schedule.inl +++ b/include/UECS/detail/Schedule.inl @@ -1,6 +1,6 @@ #pragma once -namespace Ubpa { +namespace Ubpa::UECS { template Schedule& Schedule::Register(Func&& func, std::string name, EntityFilter filter) { Request(std::forward(func), std::move(name), std::move(filter)); diff --git a/include/UECS/detail/SysFuncGraph.h b/include/UECS/detail/SysFuncGraph.h index 6e54ab2..ab11297 100644 --- a/include/UECS/detail/SysFuncGraph.h +++ b/include/UECS/detail/SysFuncGraph.h @@ -4,7 +4,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { class SystemFunc; class SysFuncGraph { public: diff --git a/include/UECS/detail/SystemFunc.inl b/include/UECS/detail/SystemFunc.inl index 5055baf..9b30187 100644 --- a/include/UECS/detail/SystemFunc.inl +++ b/include/UECS/detail/SystemFunc.inl @@ -2,12 +2,12 @@ #include <_deps/nameof.hpp> -namespace Ubpa::detail::System_ { +namespace Ubpa::UECS::detail::System_ { template auto Pack(Func&& func) noexcept; } -namespace Ubpa { +namespace Ubpa::UECS { template SystemFunc::SystemFunc(Func&& func, std::string name, EntityLocator locator, EntityFilter filter) : isJob{ IsEmpty_v> }, @@ -40,7 +40,7 @@ namespace Ubpa { } } -namespace Ubpa::detail::System_ { +namespace Ubpa::UECS::detail::System_ { template struct Packer; diff --git a/include/UECS/detail/SystemMngr.inl b/include/UECS/detail/SystemMngr.inl index 908357f..1efbcbe 100644 --- a/include/UECS/detail/SystemMngr.inl +++ b/include/UECS/detail/SystemMngr.inl @@ -1,6 +1,6 @@ #pragma once -namespace Ubpa { +namespace Ubpa::UECS { template void SystemMngr::RegisterOne() { Register(std::string{ nameof::nameof_type() }, &System::OnUpdate); diff --git a/include/UECS/detail/Util.h b/include/UECS/detail/Util.h index 6fc2d81..5d4158c 100644 --- a/include/UECS/detail/Util.h +++ b/include/UECS/detail/Util.h @@ -3,7 +3,7 @@ #include #include -namespace Ubpa { +namespace Ubpa::UECS { static constexpr size_t size_t_invalid = static_cast(-1); inline constexpr size_t hash_combine(size_t x, size_t y) noexcept; diff --git a/include/UECS/detail/Util.inl b/include/UECS/detail/Util.inl index f9cc938..5150b04 100644 --- a/include/UECS/detail/Util.inl +++ b/include/UECS/detail/Util.inl @@ -2,7 +2,7 @@ #include -namespace Ubpa { +namespace Ubpa::UECS { constexpr size_t hash_combine(size_t x, size_t y) noexcept { return x ^ (y + 0x9e3779b9 + (x << 6) + (x >> 2)); } diff --git a/src/core/Archetype.cpp b/src/core/Archetype.cpp index 0446b4b..cc7c647 100644 --- a/src/core/Archetype.cpp +++ b/src/core/Archetype.cpp @@ -1,6 +1,6 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; void Archetype::SetLayout() { diff --git a/src/core/Chunk.cpp b/src/core/Chunk.cpp index 38853fe..1d6bb1a 100644 --- a/src/core/Chunk.cpp +++ b/src/core/Chunk.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; Chunk::Layout Chunk::GenLayout(const vector& alignments, const vector& sizes) noexcept { diff --git a/src/core/EntityFilter.cpp b/src/core/EntityFilter.cpp index 766620d..69ff967 100644 --- a/src/core/EntityFilter.cpp +++ b/src/core/EntityFilter.cpp @@ -1,6 +1,6 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; EntityFilter::EntityFilter() : allHashCode{ TypeID }, diff --git a/src/core/EntityLocator.cpp b/src/core/EntityLocator.cpp index 3a14c65..bcdd4b1 100644 --- a/src/core/EntityLocator.cpp +++ b/src/core/EntityLocator.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; EntityLocator::EntityLocator(set lastFrameCmpts, diff --git a/src/core/EntityMngr.cpp b/src/core/EntityMngr.cpp index aa2c750..e879796 100644 --- a/src/core/EntityMngr.cpp +++ b/src/core/EntityMngr.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; EntityMngr::~EntityMngr() { diff --git a/src/core/RTDCmptsView.cpp b/src/core/RTDCmptsView.cpp index c65859b..e294ea2 100644 --- a/src/core/RTDCmptsView.cpp +++ b/src/core/RTDCmptsView.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; RTDCmptsView::Iterator RTDCmptsView::begin() const noexcept { diff --git a/src/core/Schedule.cpp b/src/core/Schedule.cpp index c2183b6..22c8e4a 100644 --- a/src/core/Schedule.cpp +++ b/src/core/Schedule.cpp @@ -4,10 +4,10 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; -namespace Ubpa::detail::Schedule_ { +namespace Ubpa::UECS::detail::Schedule_ { struct NoneGroup { NoneGroup() = default; NoneGroup(SystemFunc* func) diff --git a/src/core/SysFuncGraph.cpp b/src/core/SysFuncGraph.cpp index 92e8b84..9647b3b 100644 --- a/src/core/SysFuncGraph.cpp +++ b/src/core/SysFuncGraph.cpp @@ -6,7 +6,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; bool SysFuncGraph::HaveVertex(SystemFunc* x) const { diff --git a/src/core/SystemMngr.cpp b/src/core/SystemMngr.cpp index 759ab01..dc0867c 100644 --- a/src/core/SystemMngr.cpp +++ b/src/core/SystemMngr.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; void SystemMngr::Accept(IListener* listener) const { listener->EnterSystemMngr(this); diff --git a/src/core/World.cpp b/src/core/World.cpp index cec9f4f..8599576 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -2,6 +2,7 @@ #include +using namespace Ubpa::UECS; using namespace Ubpa; using namespace std; diff --git a/src/test/00_basic/main.cpp b/src/test/00_basic/main.cpp index 46e73d5..441e28b 100644 --- a/src/test/00_basic/main.cpp +++ b/src/test/00_basic/main.cpp @@ -1,10 +1,12 @@ #include +using namespace Ubpa::UECS; + struct Position { float val; }; struct Velocity { float val; }; struct MoverSystem { - static void OnUpdate(Ubpa::Schedule& schedule) { + static void OnUpdate(Schedule& schedule) { schedule.Register( [](const Velocity* v, Position* p) { p->val += v->val; @@ -13,7 +15,7 @@ struct MoverSystem { }; int main() { - Ubpa::World w; + World w; w.systemMngr.Register(); w.entityMngr.Create(); w.Update(); diff --git a/src/test/01_tag/main.cpp b/src/test/01_tag/main.cpp index 80a1af6..d242df8 100644 --- a/src/test/01_tag/main.cpp +++ b/src/test/01_tag/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct Data {}; diff --git a/src/test/02_order/main.cpp b/src/test/02_order/main.cpp index 4f93698..2ef5d17 100644 --- a/src/test/02_order/main.cpp +++ b/src/test/02_order/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct Data1 {}; diff --git a/src/test/03_query_entity/main.cpp b/src/test/03_query_entity/main.cpp index c7d5694..2675a48 100644 --- a/src/test/03_query_entity/main.cpp +++ b/src/test/03_query_entity/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct A {}; diff --git a/src/test/04_filter/main.cpp b/src/test/04_filter/main.cpp index e7da91a..dcd81e1 100644 --- a/src/test/04_filter/main.cpp +++ b/src/test/04_filter/main.cpp @@ -2,6 +2,7 @@ #include +using namespace Ubpa::UECS; using namespace Ubpa; using namespace std; diff --git a/src/test/05_alignment/main.cpp b/src/test/05_alignment/main.cpp index fc5490c..f5938d9 100644 --- a/src/test/05_alignment/main.cpp +++ b/src/test/05_alignment/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct alignas(1) A { diff --git a/src/test/06_none_parallel/main.cpp b/src/test/06_none_parallel/main.cpp index eebd069..95ef1c1 100644 --- a/src/test/06_none_parallel/main.cpp +++ b/src/test/06_none_parallel/main.cpp @@ -2,6 +2,7 @@ #include +using namespace Ubpa::UECS; using namespace Ubpa; using namespace std; diff --git a/src/test/07_overload/main.cpp b/src/test/07_overload/main.cpp index f192e9f..8d337ce 100644 --- a/src/test/07_overload/main.cpp +++ b/src/test/07_overload/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct P {}; diff --git a/src/test/08_job/main.cpp b/src/test/08_job/main.cpp index 5a82984..ad83d08 100644 --- a/src/test/08_job/main.cpp +++ b/src/test/08_job/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct Data { size_t value; }; diff --git a/src/test/09_idx_in_query/main.cpp b/src/test/09_idx_in_query/main.cpp index 5e1c938..6a4e817 100644 --- a/src/test/09_idx_in_query/main.cpp +++ b/src/test/09_idx_in_query/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct A {}; diff --git a/src/test/10_instantiate/main.cpp b/src/test/10_instantiate/main.cpp index 2da65e4..752ccba 100644 --- a/src/test/10_instantiate/main.cpp +++ b/src/test/10_instantiate/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct A { float val; }; diff --git a/src/test/11_runtime_cmpt/main.cpp b/src/test/11_runtime_cmpt/main.cpp index ec69bbe..e7bc77a 100644 --- a/src/test/11_runtime_cmpt/main.cpp +++ b/src/test/11_runtime_cmpt/main.cpp @@ -2,7 +2,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct RTDSystem { diff --git a/src/test/12_framegraph/main.cpp b/src/test/12_framegraph/main.cpp index 46b180a..70afb38 100644 --- a/src/test/12_framegraph/main.cpp +++ b/src/test/12_framegraph/main.cpp @@ -2,6 +2,7 @@ #include +using namespace Ubpa::UECS; using namespace Ubpa; using namespace std; diff --git a/src/test/13_performance/main.cpp b/src/test/13_performance/main.cpp index 2aa8107..2591c80 100644 --- a/src/test/13_performance/main.cpp +++ b/src/test/13_performance/main.cpp @@ -1,5 +1,7 @@ #include +using namespace Ubpa::UECS; + #include #include @@ -7,7 +9,7 @@ struct A { float val; }; struct B { float val; }; struct TestSystem { - static void OnUpdate(Ubpa::Schedule& schedule) { + static void OnUpdate(Schedule& schedule) { schedule.Register( [](const A* a, B* b) { // 256 floating-point operations @@ -20,7 +22,7 @@ struct TestSystem { int main() { size_t numEntities = 65536; size_t numUpdate = 144 * 10; - Ubpa::World w; + World w; w.systemMngr.Register(); auto t0 = std::chrono::steady_clock::now(); diff --git a/src/test/14_serialize/main.cpp b/src/test/14_serialize/main.cpp index 8f2ce3f..28b9821 100644 --- a/src/test/14_serialize/main.cpp +++ b/src/test/14_serialize/main.cpp @@ -3,7 +3,7 @@ #include -using namespace Ubpa; +using namespace Ubpa::UECS; using namespace std; struct Position { float val; };