Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F620546
RemoveEntitiesSystem.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
RemoveEntitiesSystem.cpp
View Options
//
// Created by Ido Mozes on 10/07/2019.
//
#include
"RemoveEntitiesSystem.h"
void
RemoveEntitiesSystem::update
(
Entities
*
layers
,
GameData
&
gameData
)
{
for
(
int
i
=
0
;
i
<
N_LAYERS
;
++
i
)
{
layers
[
i
].
erase
(
std
::
remove_if
(
layers
[
i
].
begin
(),
layers
[
i
].
end
(),
[
&
layers
,
&
gameData
](
auto
&
entity
)
{
if
(
auto
moveEntityEventP
=
entity
->
template
getComponent
<
MoveEntityEvent
>
())
{
int
newLayer
=
moveEntityEventP
->
toLayer
;
entity
->
template
removeComponent
<
MoveEntityEvent
>
();
layers
[
newLayer
].
emplace_back
(
std
::
move
(
entity
));
}
if
(
entity
and
entity
->
template
getComponent
<
RangeShadow
>
()
and
entity
->
template
getComponent
<
RangeShadow
>
()
->
entity
!=
gameData
.
selected
)
return
true
;
return
!
entity
or
entity
->
template
getComponent
<
RemoveEntityEvent
>
();
}),
layers
[
i
].
end
());
}
if
(
layers
[
SEQUENCES_LAYER
].
empty
()
and
layers
[
BLOONS_LAYER
].
empty
())
{
gameData
.
levelReady
=
gameData
.
levelRunning
=
false
;
if
(
gameData
.
level
<=
gameData
.
finalLevel
and
gameData
.
lives
>
0
)
gameData
.
level
+=
1
;
auto
[
texture
,
surface
]
=
gameData
.
getTexture
(
"Play"
);
gameData
.
playButton
->
getComponent
<
Visibility
>
()
->
reloadTexture
(
texture
,
surface
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 6:09 PM (15 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
135988
Default Alt Text
RemoveEntitiesSystem.cpp (1 KB)
Attached To
Mode
R74 BloonsTD
Attached
Detach File
Event Timeline