minor changes
This commit is contained in:
@@ -227,7 +227,7 @@ public:
|
||||
*/
|
||||
template<typename Func>
|
||||
void each(Func func) {
|
||||
const_cast<const PersistentView *>(this)->each([&func](auto entity, const Component &... component) {
|
||||
const_cast<const PersistentView *>(this)->each([&func](entity_type entity, const Component &... component) {
|
||||
func(entity, const_cast<Component &>(component)...);
|
||||
});
|
||||
}
|
||||
@@ -497,7 +497,7 @@ public:
|
||||
*/
|
||||
template<typename Func>
|
||||
void each(Func func) {
|
||||
const_cast<const View *>(this)->each([&func](auto entity, const Component &... component) {
|
||||
const_cast<const View *>(this)->each([&func](entity_type entity, const Component &... component) {
|
||||
func(entity, const_cast<Component &>(component)...);
|
||||
});
|
||||
}
|
||||
@@ -752,7 +752,7 @@ public:
|
||||
*/
|
||||
template<typename Func>
|
||||
void each(Func func) {
|
||||
const_cast<const View *>(this)->each([&func](auto entity, const Component &component) {
|
||||
const_cast<const View *>(this)->each([&func](entity_type entity, const Component &component) {
|
||||
func(entity, const_cast<Component &>(component));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Dispatcher final {
|
||||
template<typename Event>
|
||||
struct SignalWrapper final: BaseSignalWrapper {
|
||||
void publish(std::size_t current) override {
|
||||
for(auto &&event: events[current]) {
|
||||
for(const auto &event: events[current]) {
|
||||
signal.publish(event);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class Dispatcher final {
|
||||
|
||||
template<typename Event>
|
||||
SignalWrapper<Event> & wrapper() {
|
||||
auto type = event_family::type<Event>();
|
||||
const auto type = event_family::type<Event>();
|
||||
|
||||
if(!(type < wrappers.size())) {
|
||||
wrappers.resize(type + 1);
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
* to reduce at a minimum the time spent in the bodies of the listeners.
|
||||
*/
|
||||
void update() {
|
||||
auto buf = buffer(mode);
|
||||
const auto buf = buffer(mode);
|
||||
mode = !mode;
|
||||
|
||||
for(auto &&wrapper: wrappers) {
|
||||
|
||||
@@ -124,7 +124,7 @@ class Emitter {
|
||||
|
||||
template<typename Event>
|
||||
Handler<Event> & handler() noexcept {
|
||||
std::size_t family = type<Event>();
|
||||
const std::size_t family = type<Event>();
|
||||
|
||||
if(!(family < handlers.size())) {
|
||||
handlers.resize(family+1);
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
*/
|
||||
template<typename Event>
|
||||
bool empty() const noexcept {
|
||||
std::size_t family = type<Event>();
|
||||
const std::size_t family = type<Event>();
|
||||
|
||||
return (!(family < handlers.size()) ||
|
||||
!handlers[family] ||
|
||||
|
||||
Reference in New Issue
Block a user