• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão3eb1fe4e1a7b229743957930d2cf4daf86c75be1 (tree)
Hora2016-10-03 05:46:03
Autorsebastian_ <bugiu@head...>
Commitersebastian_

Mensagem de Log

Got rid of event relation.

Mudança Sumário

Diff

diff -r dcc9e8c61081 -r 3eb1fe4e1a7b Classes/EventRelation.cpp
--- a/Classes/EventRelation.cpp Sat Oct 01 22:28:17 2016 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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-}
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b Classes/EventRelation.h
--- a/Classes/EventRelation.h Sat Oct 01 22:28:17 2016 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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-
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b Classes/GateControl.cpp
--- a/Classes/GateControl.cpp Sat Oct 01 22:28:17 2016 +0300
+++ b/Classes/GateControl.cpp Sun Oct 02 23:46:03 2016 +0300
@@ -1,11 +1,11 @@
11 #include "GateControl.h"
22
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_)
55 {
66 }
77
88 void GateControlEvent::operator()()
99 {
10- eventRelation->affectEntities();
10+
1111 }
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b Classes/GateControl.h
--- a/Classes/GateControl.h Sat Oct 01 22:28:17 2016 +0300
+++ b/Classes/GateControl.h Sun Oct 02 23:46:03 2016 +0300
@@ -1,15 +1,13 @@
11 #ifndef _GATE_CONTROL_H_
22 #define _GATE_CONTROL_H_
33 #include "Event.h"
4-#include "EventRelation.h"
54 #include <memory>
65
76 class GateControlEvent : public GameEvent::Event
87 {
98 private:
10- std::unique_ptr<EventRelation> eventRelation;
119 public:
12- explicit GateControlEvent(artemis::World& world_, std::unique_ptr<EventRelation> eventRelation);
10+ explicit GateControlEvent(artemis::World& world_);
1311
1412 void operator()() override;
1513
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b compile_howto.txt
--- a/compile_howto.txt Sat Oct 01 22:28:17 2016 +0300
+++ b/compile_howto.txt Sun Oct 02 23:46:03 2016 +0300
@@ -1,2 +1,5 @@
11 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
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b proj.win32/OfficeWork.vcxproj
--- a/proj.win32/OfficeWork.vcxproj Sat Oct 01 22:28:17 2016 +0300
+++ b/proj.win32/OfficeWork.vcxproj Sun Oct 02 23:46:03 2016 +0300
@@ -166,7 +166,6 @@
166166 <ClCompile Include="..\Classes\CreditsMenuScene.cpp" />
167167 <ClCompile Include="..\Classes\EndCondition.cpp" />
168168 <ClCompile Include="..\Classes\EventList.cpp" />
169- <ClCompile Include="..\Classes\EventRelation.cpp" />
170169 <ClCompile Include="..\Classes\EventUpdateSystem.cpp" />
171170 <ClCompile Include="..\Classes\GameCompletedScene.cpp" />
172171 <ClCompile Include="..\Classes\GameOverScene.cpp" />
@@ -235,7 +234,6 @@
235234 <ClInclude Include="..\Classes\Event.h" />
236235 <ClInclude Include="..\Classes\EventList.h" />
237236 <ClInclude Include="..\Classes\EventProperties.h" />
238- <ClInclude Include="..\Classes\EventRelation.h" />
239237 <ClInclude Include="..\Classes\EventUpdateSystem.h" />
240238 <ClInclude Include="..\Classes\GameCompletedScene.h" />
241239 <ClInclude Include="..\Classes\GameOverScene.h" />
diff -r dcc9e8c61081 -r 3eb1fe4e1a7b proj.win32/OfficeWork.vcxproj.filters
--- a/proj.win32/OfficeWork.vcxproj.filters Sat Oct 01 22:28:17 2016 +0300
+++ b/proj.win32/OfficeWork.vcxproj.filters Sun Oct 02 23:46:03 2016 +0300
@@ -156,9 +156,6 @@
156156 <ClCompile Include="..\Classes\CollisionDetectionSystem.cpp">
157157 <Filter>src\systems</Filter>
158158 </ClCompile>
159- <ClCompile Include="..\Classes\EventRelation.cpp">
160- <Filter>src</Filter>
161- </ClCompile>
162159 <ClCompile Include="..\Classes\GateChange.cpp">
163160 <Filter>src\events</Filter>
164161 </ClCompile>
@@ -377,9 +374,6 @@
377374 <ClInclude Include="..\Classes\CollisionDetectionSystem.h">
378375 <Filter>src\systems</Filter>
379376 </ClInclude>
380- <ClInclude Include="..\Classes\EventRelation.h">
381- <Filter>src</Filter>
382- </ClInclude>
383377 <ClInclude Include="..\Classes\GateChange.h">
384378 <Filter>src\events</Filter>
385379 </ClInclude>