removeTile method

  1. @override
void removeTile(
  1. String id
)
override

Implementation

@override
void removeTile(String id) {
  try {
    children
        .firstWhere((element) => (element as Tile).id == id)
        .removeFromParent();
    tiles.removeWhere((element) => element.id == id);
    quadTree?.removeById(id);
    _calculateStartPosition();
    size = _calculateMapSize();
  } catch (e) {
    // ignore: avoid_print
    print('Not found visible tile with $id id');
  }
}