MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetBadge

Function GetBadge

src/newgrf_badge.cpp:113–117  ·  view source on GitHub ↗

* Get a badge if it exists. * @param index Index of badge. * @returns Badge with specified index, or nullptr if it does not exist. */

Source from the content-addressed store, hash-verified

111 * @returns Badge with specified index, or nullptr if it does not exist.
112 */
113Badge *GetBadge(BadgeID index)
114{
115 if (index.base() >= std::size(_badges.specs)) return nullptr;
116 return &_badges.specs[index.base()];
117}
118
119/**
120 * Get a badge by label if it exists.

Callers 15

DrawMainPanelWidgetMethod · 0.85
DrawBadgeNameListFunction · 0.85
DrawBadgeColumnFunction · 0.85
GetStringParameterMethod · 0.85
SetBadgeFilterFunction · 0.85
GetClassBadgeFunction · 0.85
MarkBadgeSeenFunction · 0.85
AppendCopyableBadgeListFunction · 0.85
UsedBadgeClassesMethod · 0.85
FeatureNewNameFunction · 0.85

Calls 2

sizeFunction · 0.50
baseMethod · 0.45

Tested by

no test coverage detected