Skip to content

Commit 54be31a

Browse files
committed
Formatter
1 parent 7d98768 commit 54be31a

26 files changed

+172
-187
lines changed

include/Ashley/core/ComponentMapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ template<typename T> class ComponentMapper {
7676
private:
7777
const ashley::ComponentType componentType;
7878
explicit ComponentMapper(std::type_index componentClass) :
79-
componentType(ashley::ComponentType::getFor(componentClass)) {
79+
componentType(ashley::ComponentType::getFor(componentClass)) {
8080
}
8181
};
8282
}

include/Ashley/core/Engine.hpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Engine {
179179
void update(float deltaTime);
180180

181181
static bool systemPriorityComparator(const std::unique_ptr<EntitySystem> &one,
182-
const std::unique_ptr<EntitySystem> &other);
182+
const std::unique_ptr<EntitySystem> &other);
183183

184184
private:
185185
std::vector<std::unique_ptr<Entity>> entities;
@@ -215,11 +215,10 @@ class Engine {
215215
class AddedListener : public ashley::Listener<Entity> {
216216
public:
217217
AddedListener(Engine * const engine) :
218-
engine(engine) {
218+
engine(engine) {
219219
}
220220

221-
virtual void receive(ashley::Signal<ashley::Entity> * const signal, ashley::Entity *object)
222-
override {
221+
virtual void receive(ashley::Signal<ashley::Entity> * const signal, ashley::Entity *object) override {
223222
engine->updateFamilyMembership(*object);
224223
}
225224

@@ -230,11 +229,10 @@ class Engine {
230229
class RemovedListener : public ashley::Listener<Entity> {
231230
public:
232231
RemovedListener(Engine * const engine) :
233-
engine(engine) {
232+
engine(engine) {
234233
}
235234

236-
virtual void receive(ashley::Signal<ashley::Entity> * const signal, ashley::Entity *object)
237-
override {
235+
virtual void receive(ashley::Signal<ashley::Entity> * const signal, ashley::Entity *object) override {
238236
engine->updateFamilyMembership(*object);
239237
}
240238

@@ -245,15 +243,14 @@ class Engine {
245243
class EngineOperationHandler : public ashley::ComponentOperationHandler {
246244
public:
247245
EngineOperationHandler(Engine *engine) :
248-
engine(engine) {
246+
engine(engine) {
249247
}
250248
virtual ~EngineOperationHandler() {
251249
}
252250

253-
virtual void add(ashley::Entity * const entity, std::unique_ptr<Component> &&component, const std::type_index typeIndex)
254-
override;
255-
virtual void remove(ashley::Entity * const entity, const std::type_index typeIndex)
256-
override;
251+
virtual void add(ashley::Entity * const entity, std::unique_ptr<Component> &&component,
252+
const std::type_index typeIndex) override;
253+
virtual void remove(ashley::Entity * const entity, const std::type_index typeIndex) override;
257254

258255
private:
259256
Engine *engine = nullptr;

include/Ashley/core/Entity.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Entity {
106106
const auto typeIndex = std::type_index(typeid(C));
107107
auto component = std::unique_ptr<Component>(new C(args...));
108108

109-
if(operationHandler != nullptr) {
109+
if (operationHandler != nullptr) {
110110
operationHandler->add(this, std::move(component), typeIndex);
111111
} else {
112112
addInternal(std::move(component), typeIndex);

include/Ashley/core/EntitySystem.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
******************************************************************************/
1616

17-
1817
#ifndef ENTITYSYSTEM_HPP_
1918
#define ENTITYSYSTEM_HPP_
2019

@@ -56,7 +55,7 @@ class EntitySystem {
5655
* Default constructor that will initialise an EntitySystem with priority 0.
5756
*/
5857
EntitySystem() :
59-
EntitySystem(DEFAULT_PRIORITY) {
58+
EntitySystem(DEFAULT_PRIORITY) {
6059
}
6160

6261
/**
@@ -65,7 +64,8 @@ class EntitySystem {
6564
*/
6665

6766
explicit EntitySystem(uint64_t priority) :
68-
processing(true), priority(priority) {
67+
processing(true),
68+
priority(priority) {
6969
}
7070

7171
/**

include/Ashley/core/Family.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class Family {
7373
* @param exclude entities cannot contain any of the components in the set. See {@link ComponentType#getBitsFor}.
7474
* @return The family
7575
*/
76-
static Family *getFor(ashley::BitsType all, ashley::BitsType one,
77-
ashley::BitsType exclude);
76+
static Family *getFor(ashley::BitsType all, ashley::BitsType one, ashley::BitsType exclude);
7877

7978
/**
8079
* @return This family's unique index
@@ -92,9 +91,9 @@ class Family {
9291
* <p>Note that use_getFor_not_constructor is a private struct defined in Family; this means you cannot call this constructor and shouldn't try to.</p>
9392
* <p>Use the various getFor methods to retrieve Family instances, not this.</p>
9493
*/
95-
explicit Family(const Family::use_getFor_not_constructor&, ashley::BitsType all,
96-
ashley::BitsType one, ashley::BitsType exclude) :
97-
Family(all, one, exclude) {
94+
explicit Family(const Family::use_getFor_not_constructor&, ashley::BitsType all, ashley::BitsType one,
95+
ashley::BitsType exclude) :
96+
Family(all, one, exclude) {
9897
}
9998

10099
/**
@@ -126,11 +125,13 @@ class Family {
126125
uint64_t index;
127126

128127
Family(ashley::BitsType all, ashley::BitsType one, ashley::BitsType exclude) :
129-
all(all), one(one), exclude(exclude), index(familyIndex++) {
128+
all(all),
129+
one(one),
130+
exclude(exclude),
131+
index(familyIndex++) {
130132
}
131133

132-
static FamilyHashType getFamilyHash(ashley::BitsType all, ashley::BitsType one,
133-
ashley::BitsType exclude);
134+
static FamilyHashType getFamilyHash(ashley::BitsType all, ashley::BitsType one, ashley::BitsType exclude);
134135

135136
// friend to allow hash function to be calculated
136137
friend struct std::hash<ashley::Family>;

include/Ashley/internal/ComponentOperations.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class ComponentOperationHandler {
3535
virtual ~ComponentOperationHandler() {
3636
}
3737

38-
virtual void add(ashley::Entity * const entity, std::unique_ptr<Component> &&component, const std::type_index typeIndex) = 0;
38+
virtual void add(ashley::Entity * const entity, std::unique_ptr<Component> &&component,
39+
const std::type_index typeIndex) = 0;
3940
virtual void remove(ashley::Entity * const entity, const std::type_index typeIndex) = 0;
4041
};
4142

@@ -56,15 +57,17 @@ struct ComponentOperation : public ashley::Poolable {
5657
std::unique_ptr<Component> component = nullptr;
5758

5859
ComponentOperation() :
59-
type(Type::NONE), typeIndex{std::unique_ptr<std::type_index>(nullptr)} {
60+
type(Type::NONE),
61+
typeIndex { std::unique_ptr<std::type_index>(nullptr) } {
6062
}
6163

6264
virtual ~ComponentOperation() {
6365
}
6466

6567
// TODO: Remove use of "new" here
6668

67-
inline void makeAdd(ashley::Entity *entity, std::unique_ptr<Component> &&component, const std::type_index typeIndex) {
69+
inline void makeAdd(ashley::Entity *entity, std::unique_ptr<Component> &&component,
70+
const std::type_index typeIndex) {
6871
this->type = Type::ADD;
6972

7073
this->entity = entity;

include/Ashley/signals/Signal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ template<typename T> class Signal {
5959
*/
6060
void remove(Listener<T> * listener) {
6161
auto it = std::find_if(listeners.begin(), listeners.end(),
62-
[&](ashley::Listener<T> *&found) {return listener == found;});
62+
[&](ashley::Listener<T> *&found) {return listener == found;});
6363

6464
if (it != listeners.end()) {
6565
listeners.erase(it);

include/Ashley/systems/IntervalIteratingSystem.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ class IntervalIteratingSystem : public ashley::IntervalSystem {
6969
void addedToEngine(Engine &engine) override;
7070
void removedFromEngine(Engine &engine) override;
7171

72-
Family *getFamily() const {
73-
return family;
74-
}
72+
Family *getFamily() const {
73+
return family;
74+
}
7575

7676
protected:
7777
void updateInterval() override;
7878

79-
virtual void processEntity(Entity *const &entity) = 0;
79+
virtual void processEntity(Entity * const &entity) = 0;
8080
};
8181

8282
}

include/Ashley/systems/IteratingSystem.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class IteratingSystem : public ashley::EntitySystem {
4141
* @param family The family of entities iterated over in this System
4242
*/
4343
explicit IteratingSystem(Family *family) :
44-
IteratingSystem(family, ashley::EntitySystem::DEFAULT_PRIORITY) {
44+
IteratingSystem(family, ashley::EntitySystem::DEFAULT_PRIORITY) {
4545
}
4646

4747
/**
@@ -51,7 +51,9 @@ class IteratingSystem : public ashley::EntitySystem {
5151
* @param priority The priority to execute this system with (lower means higher priority)
5252
*/
5353
IteratingSystem(Family *family, uint64_t priority) :
54-
EntitySystem(priority), family(family), entities() {
54+
EntitySystem(priority),
55+
family(family),
56+
entities() {
5557
}
5658

5759
virtual ~IteratingSystem() = default;
@@ -78,9 +80,9 @@ class IteratingSystem : public ashley::EntitySystem {
7880
*/
7981
virtual bool checkProcessing() override;
8082

81-
Family *getFamily() const {
82-
return family;
83-
}
83+
Family *getFamily() const {
84+
return family;
85+
}
8486

8587
protected:
8688
/**

include/Ashley/util/ObjectPools.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ template<typename T> class ObjectPool {
5454

5555
public:
5656
explicit ObjectPool(int64_t startEntities = 100) :
57-
peakEntities(0) {
57+
peakEntities(0) {
5858
if (startEntities < 1) {
5959
throw std::invalid_argument("startEntities must be greater than or equal to 1!");
6060
}

0 commit comments

Comments
 (0)