OpenTTD Source: BadgeTextFilter Class Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Private Attributes
BadgeTextFilter Class Reference

## Public Member Functions
| BadgeTextFilter (struct StringFilter &filter, GrfSpecFeature feature)
| Construct a badge text filter.
bool | Filter (std::span< const BadgeID > badges) const
| Test if any of the given badges matches the filtered badge list.

## Private Attributes
FlatSet< BadgeID > | badges {}

## Detailed Description

Definition at line 71 of file newgrf_badge.h.

## Constructor & Destructor Documentation

## ◆ BadgeTextFilter()

BadgeTextFilter::BadgeTextFilter | ( | struct StringFilter & | filter,
|  | GrfSpecFeature | feature
| ) |  |

Construct a badge text filter.

Parameters

  filter | string filter.
  feature | feature being used.

Definition at line 317 of file newgrf_badge.cpp.

References GetBadges(), StringFilter::GetState(), GetString(), StringFilter::IsEmpty(), and StringFilter::ResetState().

## Member Function Documentation

## ◆ Filter()

bool BadgeTextFilter::Filter | ( | std::span< const BadgeID > | badges | ) | const

Test if any of the given badges matches the filtered badge list.

Parameters

  badges | List of badges.

Returns
  true iff at least one badge in badges is present.

Definition at line 340 of file newgrf_badge.cpp.

## Field Documentation

## ◆ badges

FlatSet<BadgeID> BadgeTextFilter::badges {}
| private

Definition at line 77 of file newgrf_badge.h.

The documentation for this class was generated from the following files:

- src/newgrf_badge.h
- src/newgrf_badge.cpp