tileTypeListBelow method

List<String>? tileTypeListBelow()

Method that checks what types map tile is currently

Implementation

List<String>? tileTypeListBelow() {
  final map = gameRef.map;
  if (map.getRendered().isNotEmpty) {
    Vector2Rect position = this.isObjectCollision()
        ? (this as ObjectCollision).rectCollision
        : this.position;
    return map
        .getRendered()
        .where((element) {
          return (element.position.overlaps(position) &&
              (element.type?.isNotEmpty ?? false));
        })
        .map<String>((e) => e.type!)
        .toList();
  }
  return null;
}