Skip to content

Commit f34292c

Browse files
committed
chore: line endings, make generate adds pending, remove comments
1 parent ff0fdd5 commit f34292c

File tree

7 files changed

+218
-201
lines changed

7 files changed

+218
-201
lines changed

ecsact/entt/detail/apply_pending.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ auto apply_pending_add(::entt::registry& registry) -> void {
1919
}
2020
);
2121
}
22-
2322
registry.clear<pending_add<C>>();
2423
}
2524

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,126 @@
1-
#pragma once
2-
3-
#include <type_traits>
4-
#include "ecsact/runtime/core.h"
5-
6-
namespace ecsact::entt::detail {
7-
8-
struct execution_events_collector {
9-
const ecsact_execution_events_collector* target;
10-
11-
inline bool has_init_callback() const {
12-
return target->init_callback != nullptr;
13-
}
14-
15-
inline bool has_update_callback() const {
16-
return target->update_callback != nullptr;
17-
}
18-
19-
inline bool has_remove_callback() const {
20-
return target->remove_callback != nullptr;
21-
}
22-
23-
inline bool has_entity_created_callback() const {
24-
return target->entity_created_callback != nullptr;
25-
}
26-
27-
inline bool has_entity_destroyed_callback() const {
28-
return target->entity_destroyed_callback != nullptr;
29-
}
30-
31-
template<typename C>
32-
requires(!std::is_empty_v<C>)
33-
void invoke_init_callback(ecsact_entity_id entity, const C& component) {
34-
target->init_callback(
35-
ECSACT_EVENT_INIT_COMPONENT,
36-
static_cast<ecsact_entity_id>(entity),
37-
static_cast<ecsact_component_id>(C::id),
38-
static_cast<const void*>(&component),
39-
target->init_callback_user_data
40-
);
41-
}
42-
43-
template<typename C>
44-
requires(std::is_empty_v<C>)
45-
void invoke_init_callback(ecsact_entity_id entity) {
46-
target->init_callback(
47-
ECSACT_EVENT_INIT_COMPONENT,
48-
static_cast<ecsact_entity_id>(entity),
49-
static_cast<ecsact_component_id>(C::id),
50-
nullptr,
51-
target->init_callback_user_data
52-
);
53-
}
54-
55-
template<typename C>
56-
requires(!std::is_empty_v<C>)
57-
void invoke_update_callback(ecsact_entity_id entity, const C& component) {
58-
target->update_callback(
59-
ECSACT_EVENT_UPDATE_COMPONENT,
60-
static_cast<ecsact_entity_id>(entity),
61-
static_cast<ecsact_component_id>(C::id),
62-
static_cast<const void*>(&component),
63-
target->update_callback_user_data
64-
);
65-
}
66-
67-
template<typename C>
68-
requires(std::is_empty_v<C>)
69-
void invoke_update_callback(ecsact_entity_id entity) {
70-
target->update_callback(
71-
ECSACT_EVENT_UPDATE_COMPONENT,
72-
static_cast<ecsact_entity_id>(entity),
73-
static_cast<ecsact_component_id>(C::id),
74-
nullptr,
75-
target->update_callback_user_data
76-
);
77-
}
78-
79-
template<typename C>
80-
requires(!std::is_empty_v<C>)
81-
void invoke_remove_callback(ecsact_entity_id entity, const C& component) {
82-
target->remove_callback(
83-
ECSACT_EVENT_REMOVE_COMPONENT,
84-
static_cast<ecsact_entity_id>(entity),
85-
static_cast<ecsact_component_id>(C::id),
86-
static_cast<const void*>(&component),
87-
target->remove_callback_user_data
88-
);
89-
}
90-
91-
template<typename C>
92-
requires(std::is_empty_v<C>)
93-
void invoke_remove_callback(ecsact_entity_id entity) {
94-
target->remove_callback(
95-
ECSACT_EVENT_REMOVE_COMPONENT,
96-
static_cast<ecsact_entity_id>(entity),
97-
static_cast<ecsact_component_id>(C::id),
98-
nullptr,
99-
target->remove_callback_user_data
100-
);
101-
}
102-
103-
void invoke_entity_created_callback(
104-
ecsact_entity_id entity,
105-
ecsact_placeholder_entity_id placeholder_entity_id
106-
) {
107-
target->entity_created_callback(
108-
ECSACT_EVENT_CREATE_ENTITY,
109-
entity,
110-
placeholder_entity_id,
111-
target->entity_created_callback_user_data
112-
);
113-
}
114-
115-
void invoke_entity_destroyed_callback(ecsact_entity_id entity) {
116-
target->entity_destroyed_callback(
117-
ECSACT_EVENT_DESTROY_ENTITY,
118-
entity,
119-
// This value doesn't matter for the destroy callback
120-
static_cast<ecsact_placeholder_entity_id>(entity),
121-
target->entity_destroyed_callback_user_data
122-
);
123-
}
124-
};
125-
126-
} // namespace ecsact::entt::detail
1+
#pragma once
2+
3+
#include <type_traits>
4+
#include "ecsact/runtime/core.h"
5+
6+
namespace ecsact::entt::detail {
7+
8+
struct execution_events_collector {
9+
const ecsact_execution_events_collector* target;
10+
11+
inline bool has_init_callback() const {
12+
return target->init_callback != nullptr;
13+
}
14+
15+
inline bool has_update_callback() const {
16+
return target->update_callback != nullptr;
17+
}
18+
19+
inline bool has_remove_callback() const {
20+
return target->remove_callback != nullptr;
21+
}
22+
23+
inline bool has_entity_created_callback() const {
24+
return target->entity_created_callback != nullptr;
25+
}
26+
27+
inline bool has_entity_destroyed_callback() const {
28+
return target->entity_destroyed_callback != nullptr;
29+
}
30+
31+
template<typename C>
32+
requires(!std::is_empty_v<C>)
33+
void invoke_init_callback(ecsact_entity_id entity, const C& component) {
34+
target->init_callback(
35+
ECSACT_EVENT_INIT_COMPONENT,
36+
static_cast<ecsact_entity_id>(entity),
37+
static_cast<ecsact_component_id>(C::id),
38+
static_cast<const void*>(&component),
39+
target->init_callback_user_data
40+
);
41+
}
42+
43+
template<typename C>
44+
requires(std::is_empty_v<C>)
45+
void invoke_init_callback(ecsact_entity_id entity) {
46+
target->init_callback(
47+
ECSACT_EVENT_INIT_COMPONENT,
48+
static_cast<ecsact_entity_id>(entity),
49+
static_cast<ecsact_component_id>(C::id),
50+
nullptr,
51+
target->init_callback_user_data
52+
);
53+
}
54+
55+
template<typename C>
56+
requires(!std::is_empty_v<C>)
57+
void invoke_update_callback(ecsact_entity_id entity, const C& component) {
58+
target->update_callback(
59+
ECSACT_EVENT_UPDATE_COMPONENT,
60+
static_cast<ecsact_entity_id>(entity),
61+
static_cast<ecsact_component_id>(C::id),
62+
static_cast<const void*>(&component),
63+
target->update_callback_user_data
64+
);
65+
}
66+
67+
template<typename C>
68+
requires(std::is_empty_v<C>)
69+
void invoke_update_callback(ecsact_entity_id entity) {
70+
target->update_callback(
71+
ECSACT_EVENT_UPDATE_COMPONENT,
72+
static_cast<ecsact_entity_id>(entity),
73+
static_cast<ecsact_component_id>(C::id),
74+
nullptr,
75+
target->update_callback_user_data
76+
);
77+
}
78+
79+
template<typename C>
80+
requires(!std::is_empty_v<C>)
81+
void invoke_remove_callback(ecsact_entity_id entity, const C& component) {
82+
target->remove_callback(
83+
ECSACT_EVENT_REMOVE_COMPONENT,
84+
static_cast<ecsact_entity_id>(entity),
85+
static_cast<ecsact_component_id>(C::id),
86+
static_cast<const void*>(&component),
87+
target->remove_callback_user_data
88+
);
89+
}
90+
91+
template<typename C>
92+
requires(std::is_empty_v<C>)
93+
void invoke_remove_callback(ecsact_entity_id entity) {
94+
target->remove_callback(
95+
ECSACT_EVENT_REMOVE_COMPONENT,
96+
static_cast<ecsact_entity_id>(entity),
97+
static_cast<ecsact_component_id>(C::id),
98+
nullptr,
99+
target->remove_callback_user_data
100+
);
101+
}
102+
103+
void invoke_entity_created_callback(
104+
ecsact_entity_id entity,
105+
ecsact_placeholder_entity_id placeholder_entity_id
106+
) {
107+
target->entity_created_callback(
108+
ECSACT_EVENT_CREATE_ENTITY,
109+
entity,
110+
placeholder_entity_id,
111+
target->entity_created_callback_user_data
112+
);
113+
}
114+
115+
void invoke_entity_destroyed_callback(ecsact_entity_id entity) {
116+
target->entity_destroyed_callback(
117+
ECSACT_EVENT_DESTROY_ENTITY,
118+
entity,
119+
// This value doesn't matter for the destroy callback
120+
static_cast<ecsact_placeholder_entity_id>(entity),
121+
target->entity_destroyed_callback_user_data
122+
);
123+
}
124+
};
125+
126+
} // namespace ecsact::entt::detail
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
#pragma once
2-
3-
#include <cstdint>
4-
#include <type_traits>
5-
#include <concepts>
6-
#include "ecsact/runtime/common.h"
7-
8-
namespace ecsact::entt::detail {
9-
10-
template<typename C, std::size_t FieldOffset>
11-
struct association {
12-
using component = C;
13-
static constexpr auto field_offset = FieldOffset;
14-
std::int_fast16_t ref_count = 0;
15-
};
16-
17-
template<typename Assoc>
18-
concept association_concept = //
19-
requires {
20-
{ typename Assoc::component_type{} };
21-
{ Assoc::field_offset } -> std::convertible_to<std::size_t>;
22-
};
23-
24-
template<typename C>
25-
struct beforeremove_storage;
26-
27-
template<typename C>
28-
requires(std::is_empty_v<C>)
29-
struct beforeremove_storage<C> {};
30-
31-
template<typename C>
32-
requires(!std::is_empty_v<C>)
33-
struct beforeremove_storage<C> {
34-
C value;
35-
};
36-
37-
template<typename C>
38-
requires(!std::is_empty_v<C>)
39-
struct beforechange_storage {
40-
C value;
41-
};
42-
43-
template<typename C>
44-
struct pending_add;
45-
46-
template<typename C>
47-
requires(std::is_empty_v<C>)
48-
struct pending_add<C> {};
49-
50-
template<typename C>
51-
requires(!std::is_empty_v<C>)
52-
struct pending_add<C> {
53-
C value;
54-
};
55-
56-
template<typename C>
57-
struct pending_remove {};
58-
59-
struct created_entity {
60-
ecsact_placeholder_entity_id placeholder_entity_id;
61-
};
62-
63-
struct destroyed_entity {};
64-
65-
} // namespace ecsact::entt::detail
1+
#pragma once
2+
3+
#include <cstdint>
4+
#include <type_traits>
5+
#include <concepts>
6+
#include "ecsact/runtime/common.h"
7+
8+
namespace ecsact::entt::detail {
9+
10+
template<typename C, std::size_t FieldOffset>
11+
struct association {
12+
using component = C;
13+
static constexpr auto field_offset = FieldOffset;
14+
std::int_fast16_t ref_count = 0;
15+
};
16+
17+
template<typename Assoc>
18+
concept association_concept = //
19+
requires {
20+
{ typename Assoc::component_type{} };
21+
{ Assoc::field_offset } -> std::convertible_to<std::size_t>;
22+
};
23+
24+
template<typename C>
25+
struct beforeremove_storage;
26+
27+
template<typename C>
28+
requires(std::is_empty_v<C>)
29+
struct beforeremove_storage<C> {};
30+
31+
template<typename C>
32+
requires(!std::is_empty_v<C>)
33+
struct beforeremove_storage<C> {
34+
C value;
35+
};
36+
37+
template<typename C>
38+
requires(!std::is_empty_v<C>)
39+
struct beforechange_storage {
40+
C value;
41+
};
42+
43+
template<typename C>
44+
struct pending_add;
45+
46+
template<typename C>
47+
requires(std::is_empty_v<C>)
48+
struct pending_add<C> {};
49+
50+
template<typename C>
51+
requires(!std::is_empty_v<C>)
52+
struct pending_add<C> {
53+
C value;
54+
};
55+
56+
template<typename C>
57+
struct pending_remove {};
58+
59+
struct created_entity {
60+
ecsact_placeholder_entity_id placeholder_entity_id;
61+
};
62+
63+
struct destroyed_entity {};
64+
65+
} // namespace ecsact::entt::detail

0 commit comments

Comments
 (0)