Skip to content

Commit 4ab820a

Browse files
committed
Added Pair type.
1 parent 4afb1b0 commit 4ab820a

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

Foundation/Public/Aurora.Scene/Entity.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// [ HEADER ]
1313
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1414

15+
#include "Pair.hpp"
1516
#include "Proxy.hpp"
1617
#include "Tag.hpp"
1718

@@ -140,16 +141,16 @@ namespace Scene
140141
}
141142

142143
// -=(Undocumented)=-
143-
template<typename Type, typename Relation>
144-
void Attach(Any<Type> Component)
144+
template<typename First, typename Second>
145+
void Attach(Any<Second> Component)
145146
{
146-
if constexpr (std::is_empty_v<Type>)
147+
if constexpr (std::is_empty_v<Second>)
147148
{
148-
mHandle.add<Relation, Type>();
149+
mHandle.add<First, Second>();
149150
}
150151
else
151152
{
152-
mHandle.set_second<Relation>(Move(Component));
153+
mHandle.set_second<First>(Move(Component));
153154
}
154155
}
155156

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2+
// Copyright (C) 2021-2025 by Agustin Alvarez. All rights reserved.
3+
//
4+
// This work is licensed under the terms of the MIT license.
5+
//
6+
// For a copy, see <https://opensource.org/licenses/MIT>.
7+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
8+
9+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
10+
// [ HEADER ]
11+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
12+
13+
#include "Pair.hpp"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2+
// Copyright (C) 2021-2025 by Agustin Alvarez. All rights reserved.
3+
//
4+
// This work is licensed under the terms of the MIT license.
5+
//
6+
// For a copy, see <https://opensource.org/licenses/MIT>.
7+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
8+
9+
#pragma once
10+
11+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
12+
// [ HEADER ]
13+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
14+
15+
#include "Common.hpp"
16+
17+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
18+
// [ CODE ]
19+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
20+
21+
namespace Scene
22+
{
23+
// -=(Undocumented)=-
24+
template<typename First, typename Second>
25+
using Pair = flecs::pair<First, Second>;
26+
}

0 commit comments

Comments
 (0)