Revisão | 3eb1fe4e1a7b229743957930d2cf4daf86c75be1 (tree) |
---|---|
Hora | 2016-10-03 05:46:03 |
Autor | sebastian_ <bugiu@head...> |
Commiter | sebastian_ |
Got rid of event relation.
@@ -1,20 +0,0 @@ | ||
1 | -#include "EventRelation.h" | |
2 | - | |
3 | -EventRelation::EventRelation(artemis::Entity& controller_, artemis::World& world) : controller(controller_) | |
4 | -{ | |
5 | - eventPropertiesMapper.init(world); | |
6 | -} | |
7 | - | |
8 | -void EventRelation::addAffectedEntity(artemis::Entity& entity) | |
9 | -{ | |
10 | - affectedEntities.push_back(entity); | |
11 | -} | |
12 | - | |
13 | -void EventRelation::affectEntities() | |
14 | -{ | |
15 | - for (auto& entity : affectedEntities) | |
16 | - { | |
17 | - auto eventProperties = eventPropertiesMapper.get(entity); | |
18 | - (*eventProperties->getEvent())(); | |
19 | - } | |
20 | -} |
@@ -1,27 +0,0 @@ | ||
1 | -#ifndef _EVENT_RELATION_H_ | |
2 | -#define _EVENT_RELATION_H_ | |
3 | -#include <vector> | |
4 | -#include "EventProperties.h" | |
5 | -#include "artemis/src/Artemis/ComponentMapper.h" | |
6 | - | |
7 | -namespace artemis{ | |
8 | - class Entity; | |
9 | -} | |
10 | - | |
11 | -class EventRelation | |
12 | -{ | |
13 | -private: | |
14 | - artemis::Entity& controller; | |
15 | - std::vector<std::reference_wrapper<artemis::Entity>> affectedEntities; | |
16 | - artemis::ComponentMapper<EventProperties> eventPropertiesMapper; | |
17 | - | |
18 | -public: | |
19 | - EventRelation(artemis::Entity& controller_, artemis::World& world); | |
20 | - | |
21 | - void addAffectedEntity(artemis::Entity& entity); | |
22 | - | |
23 | - void affectEntities(); | |
24 | -}; | |
25 | - | |
26 | -#endif | |
27 | - |
@@ -1,11 +1,11 @@ | ||
1 | 1 | #include "GateControl.h" |
2 | 2 | |
3 | -GateControlEvent::GateControlEvent(artemis::World& world_, std::unique_ptr<EventRelation> eventRelation_) | |
4 | - : Event(world_), eventRelation(std::move(eventRelation_)) | |
3 | +GateControlEvent::GateControlEvent(artemis::World& world_) | |
4 | + : Event(world_) | |
5 | 5 | { |
6 | 6 | } |
7 | 7 | |
8 | 8 | void GateControlEvent::operator()() |
9 | 9 | { |
10 | - eventRelation->affectEntities(); | |
10 | + | |
11 | 11 | } |
@@ -1,15 +1,13 @@ | ||
1 | 1 | #ifndef _GATE_CONTROL_H_ |
2 | 2 | #define _GATE_CONTROL_H_ |
3 | 3 | #include "Event.h" |
4 | -#include "EventRelation.h" | |
5 | 4 | #include <memory> |
6 | 5 | |
7 | 6 | class GateControlEvent : public GameEvent::Event |
8 | 7 | { |
9 | 8 | private: |
10 | - std::unique_ptr<EventRelation> eventRelation; | |
11 | 9 | public: |
12 | - explicit GateControlEvent(artemis::World& world_, std::unique_ptr<EventRelation> eventRelation); | |
10 | + explicit GateControlEvent(artemis::World& world_); | |
13 | 11 | |
14 | 12 | void operator()() override; |
15 | 13 |
@@ -1,2 +1,5 @@ | ||
1 | 1 | Compile for android. If want to compile for x86 add --app-abi x86 |
2 | -cocos compile -p android --android-studio | |
\ No newline at end of file | ||
2 | +cocos compile -p android --android-studio | |
3 | + | |
4 | +Deploy in bin | |
5 | +cocos deploy -p win32 -m release | |
\ No newline at end of file |
@@ -166,7 +166,6 @@ | ||
166 | 166 | <ClCompile Include="..\Classes\CreditsMenuScene.cpp" /> |
167 | 167 | <ClCompile Include="..\Classes\EndCondition.cpp" /> |
168 | 168 | <ClCompile Include="..\Classes\EventList.cpp" /> |
169 | - <ClCompile Include="..\Classes\EventRelation.cpp" /> | |
170 | 169 | <ClCompile Include="..\Classes\EventUpdateSystem.cpp" /> |
171 | 170 | <ClCompile Include="..\Classes\GameCompletedScene.cpp" /> |
172 | 171 | <ClCompile Include="..\Classes\GameOverScene.cpp" /> |
@@ -235,7 +234,6 @@ | ||
235 | 234 | <ClInclude Include="..\Classes\Event.h" /> |
236 | 235 | <ClInclude Include="..\Classes\EventList.h" /> |
237 | 236 | <ClInclude Include="..\Classes\EventProperties.h" /> |
238 | - <ClInclude Include="..\Classes\EventRelation.h" /> | |
239 | 237 | <ClInclude Include="..\Classes\EventUpdateSystem.h" /> |
240 | 238 | <ClInclude Include="..\Classes\GameCompletedScene.h" /> |
241 | 239 | <ClInclude Include="..\Classes\GameOverScene.h" /> |
@@ -156,9 +156,6 @@ | ||
156 | 156 | <ClCompile Include="..\Classes\CollisionDetectionSystem.cpp"> |
157 | 157 | <Filter>src\systems</Filter> |
158 | 158 | </ClCompile> |
159 | - <ClCompile Include="..\Classes\EventRelation.cpp"> | |
160 | - <Filter>src</Filter> | |
161 | - </ClCompile> | |
162 | 159 | <ClCompile Include="..\Classes\GateChange.cpp"> |
163 | 160 | <Filter>src\events</Filter> |
164 | 161 | </ClCompile> |
@@ -377,9 +374,6 @@ | ||
377 | 374 | <ClInclude Include="..\Classes\CollisionDetectionSystem.h"> |
378 | 375 | <Filter>src\systems</Filter> |
379 | 376 | </ClInclude> |
380 | - <ClInclude Include="..\Classes\EventRelation.h"> | |
381 | - <Filter>src</Filter> | |
382 | - </ClInclude> | |
383 | 377 | <ClInclude Include="..\Classes\GateChange.h"> |
384 | 378 | <Filter>src\events</Filter> |
385 | 379 | </ClInclude> |