Renaming remove to markToRemove

This commit is contained in:
Erick Zanardo
2020-06-23 18:52:52 -03:00
parent 72ba478412
commit 339ed06c3d
5 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# CHANGELOG
## [next]
- Adding BaseGame#remove
- Adding BaseGame#markToRemove
- Upgrade tiled and flutter_svg dependencies
## 0.22.1

View File

@ -45,7 +45,7 @@ A very simple `BaseGame` implementation example can be seen below:
}
```
To remove components from the list on a `BaseGame` the `remove` can be used.
To remove components from the list on a `BaseGame` the `markToRemove` method can be used.
## Flutter Widgets and Game instances

View File

@ -69,7 +69,7 @@ class MyGame extends BaseGame with DoubleTapDetector, TapDetector {
components.forEach((c) {
if (c is PositionComponent && c.toRect().overlaps(touchArea)) {
handled = true;
remove(c);
markToRemove(c);
}
});

View File

@ -75,7 +75,7 @@ mixin ComposedComponent on Component, HasGameRef, Tapable {
components.add(c);
}
void remove(Component component) {
void markToRemove(Component component) {
_removeLater.add(component);
}

View File

@ -89,8 +89,8 @@ class BaseGame extends Game {
_addLater.add(c);
}
/// Removes a component from the components list
void remove(Component c) {
/// Marks a component to be removed from the components list on the next game loop cycle
void markToRemove(Component c) {
_removeLater.add(c);
}