OpenTTD Source 20250221-master-gcc93699459
BadgeScopeResolver Struct Reference

Resolver for a badge scope. More...

Inheritance diagram for BadgeScopeResolver:
ScopeResolver

Public Member Functions

 BadgeScopeResolver (ResolverObject &ro, const Badge &badge, const std::optional< TimerGameCalendar::Date > introduction_date)
 Scope resolver of a badge.
 
uint32_t GetVariable (uint8_t variable, uint32_t parameter, bool &available) const override
 Get a variable value.
 
- Public Member Functions inherited from ScopeResolver
 ScopeResolver (ResolverObject &ro)
 
virtual uint32_t GetRandomBits () const
 Get a few random bits.
 
virtual uint32_t GetTriggers () const
 Get the triggers.
 
virtual void StorePSA (uint reg, int32_t value)
 Store a value into the persistent storage area (PSA).
 

Data Fields

const Badgebadge
 
const std::optional< TimerGameCalendar::Dateintroduction_date
 
- Data Fields inherited from ScopeResolver
ResolverObjectro
 Surrounding resolver object.
 

Detailed Description

Resolver for a badge scope.

Definition at line 130 of file newgrf_badge.cpp.

Constructor & Destructor Documentation

◆ BadgeScopeResolver()

BadgeScopeResolver::BadgeScopeResolver ( ResolverObject ro,
const Badge badge,
const std::optional< TimerGameCalendar::Date introduction_date 
)
inline

Scope resolver of a badge.

Parameters
roSurrounding resolver.
badgeBadge to resolve.
introduction_dateIntroduction date of entity.

Definition at line 140 of file newgrf_badge.cpp.

Member Function Documentation

◆ GetVariable()

uint32_t BadgeScopeResolver::GetVariable ( uint8_t  variable,
uint32_t  parameter,
bool &  available 
) const
overridevirtual

Get a variable value.

Default implementation has no available variables.

Parameters
variableVariable to read
parameterParameter for 60+x variables
[out]availableSet to false, in case the variable does not exist.
Returns
Value

Reimplemented from ScopeResolver.

Definition at line 146 of file newgrf_badge.cpp.

References TimerGameCalendar::date.

Field Documentation

◆ badge

const Badge& BadgeScopeResolver::badge

Definition at line 131 of file newgrf_badge.cpp.

◆ introduction_date

const std::optional<TimerGameCalendar::Date> BadgeScopeResolver::introduction_date

Definition at line 132 of file newgrf_badge.cpp.


The documentation for this struct was generated from the following file: