38 inline std::span<const BadgeClassID> Classes()
const
67 bool Filter(std::span<const BadgeID> badges)
const;
BadgeClassID class_index
Index of class this badge belongs to.
VariableGRFFileProps< GrfSpecFeature > grf_prop
Sprite information.
std::string label
Label of badge.
BadgeID index
Index assigned to badge.
BadgeFlags flags
Display flags.
GrfSpecFeatures features
Bitmask of which features use this badge.
Flat set implementation that uses a sorted vector for storage.
Utility class to create a list of badge classes used by a feature.
std::vector< BadgeClassID > classes
List of badge classes.
Flat set container implementation.
uint32_t PaletteID
The number of the palette.
Base for the NewGRF implementation.
uint32_t GetBadgeVariableResult(const GRFFile &grffile, std::span< const BadgeID > badges, uint32_t parameter)
Test for a matching badge in a list of badges, returning the number of matching bits.
Badge * GetBadge(BadgeID index)
Get a badge if it exists.
std::span< const Badge > GetBadges()
Get a read-only view of badges.
void ApplyBadgeFeaturesToClassBadges()
Apply features from all badges to their badge classes.
void MarkBadgeSeen(BadgeID index, GrfSpecFeature feature)
Mark a badge a seen (used) by a feature.
void AppendCopyableBadgeList(std::vector< BadgeID > &dst, std::span< const BadgeID > src, GrfSpecFeature feature)
Append copyable badges from a list onto another.
PalSpriteID GetBadgeSprite(const Badge &badge, GrfSpecFeature feature, std::optional< TimerGameCalendar::Date > introduction_date, PaletteID remap)
Get sprite for the given badge.
std::span< const BadgeID > GetClassBadges()
Get a read-only view of class badge index.
Badge * GetClassBadge(BadgeClassID class_index)
Get the badge class of a badge label.
Badge & GetOrCreateBadge(std::string_view label)
Register a badge label and return its global index.
Badge * GetBadgeByLabel(std::string_view label)
Get a badge by label if it exists.
void ResetBadges()
Reset badges to the default state.
Types related to NewGRF badges.
This file simplyfies and embeds a common mechanism of loading/saving and mapping of grf entities.
@ Filter
filter disabled/enabled
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Dynamic data of a loaded NewGRF.
Combination of a palette sprite and a 'real' sprite.
Variable-length list of sprite groups for an entity.
Definition of the game-calendar-timer.