OpenTTD Source: BadgeScopeResolver Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
BadgeScopeResolver Struct Reference

Resolver for a badge scope. More...

Inheritance diagram for BadgeScopeResolver:

## 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 | GetRandomTriggers () const
| Get the triggers.
virtual void | StorePSA (uint reg, int32_t value)
| Store a value into the persistent storage area (PSA).

## Data Fields
const Badge & | badge
const std::optional< TimerGameCalendar::Date > | introduction_date
Data Fields inherited from ScopeResolver
ResolverObject & | ro
| Surrounding resolver object.

## Detailed Description

Resolver for a badge scope.

Definition at line 144 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

  ro | Surrounding resolver.
  badge | Badge to resolve.
  introduction_date | Introduction date of entity.

Definition at line 154 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

  | variable | Variable to read
  | parameter | Parameter for 60+x variables
  [out] | available | Set to false, in case the variable does not exist.

Returns
  Value

Reimplemented from ScopeResolver.

Definition at line 160 of file newgrf_badge.cpp.

References TimerGameCalendar::date.

## Field Documentation

## ◆ badge

const Badge& BadgeScopeResolver::badge

Definition at line 145 of file newgrf_badge.cpp.

## ◆ introduction_date

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

Definition at line 146 of file newgrf_badge.cpp.

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

- src/newgrf_badge.cpp