void receive(const EntityCreatedEvent &event) { ++created; }
void receive(const EntityDestroyedEvent &event) { ++destroyed; }
- int created = 0;
- int destroyed = 0;
+ long unsigned int created = 0;
+ long unsigned int destroyed = 0;
};
struct Position : public Component<Position> {
Listener listen;
ev.subscribe<EntityCreatedEvent>(listen);
- int count = 10000000L;
+ long unsigned int count = 10000000L;
AutoTimer t;
cout << "creating " << count << " entities while notifying a single EntityCreatedEvent listener" << endl;
vector<Entity> entities;
- for (int i = 0; i < count; i++) {
+ for (long unsigned int i = 0; i < count; i++) {
entities.push_back(em.create());
}
}
TEST_CASE_METHOD(BenchmarkFixture, "TestDestroyEntitiesWithListener") {
- int count = 10000000;
+ long unsigned int count = 10000000;
vector<Entity> entities;
- for (int i = 0; i < count; i++) {
+ for (long unsigned int i = 0; i < count; i++) {
entities.push_back(em.create());
}
}
TEST_CASE_METHOD(BenchmarkFixture, "TestEntityIteration") {
- int count = 10000000;
- for (int i = 0; i < count; i++) {
+ long unsigned int count = 10000000;
+ for (long unsigned int i = 0; i < count; i++) {
auto e = em.create();
e.assign<Position>();
}
}
TEST_CASE_METHOD(BenchmarkFixture, "TestEntityIterationUnpackTwo") {
- int count = 10000000;
- for (int i = 0; i < count; i++) {
+ long unsigned int count = 10000000;
+ for (long unsigned int i = 0; i < count; i++) {
auto e = em.create();
e.assign<Position>();
e.assign<Direction>();
public:
using iterator_category = std::input_iterator_tag;
using value_type = Entity::Id;
- using difference_type = Entity::Id;
+ using difference_type = int;
using pointer = const Entity::Id*;
using reference = const Entity::Id&;