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

Function FindCompanyManagerFaceLabel

src/company_cmd.cpp:1409–1415  ·  view source on GitHub ↗

* Find a company manager face style by label. * @param label Label to find. * @return Index of face style if label is found, otherwise std::nullopt. */

Source from the content-addressed store, hash-verified

1407 * @return Index of face style if label is found, otherwise std::nullopt.
1408 */
1409std::optional<uint> FindCompanyManagerFaceLabel(std::string_view label)
1410{
1411 auto it = std::ranges::find(_faces, label, &FaceSpec::label);
1412 if (it == std::end(_faces)) return std::nullopt;
1413
1414 return static_cast<uint>(std::distance(std::begin(_faces), it));
1415}
1416
1417/**
1418 * Get the face variables for a face style.

Callers 2

AfterLoadGameFunction · 0.85

Calls 3

findFunction · 0.50
endFunction · 0.50
beginFunction · 0.50

Tested by

no test coverage detected