OpenTTD Source: AllowedSubtags Struct Reference

OpenTTD Source 15.3

Public Types | Data Fields
AllowedSubtags Struct Reference

Data structure to store the allowed id/type combinations for action 14. More...

## Public Types
using | Span = std::pair< const AllowedSubtags *, const AllowedSubtags * >
| Custom 'span' of subtags.

## Data Fields
uint32_t | id
| The identifier for this node.
std::variant< DataHandler, TextHandler, BranchHandler, Span > | handler
| The handler for this node.

## Detailed Description

Data structure to store the allowed id/type combinations for action 14.

The data can be represented as a tree with 3 types of nodes:

1. Branch nodes (identified by 'C' for choice).
2. Binary leaf nodes (identified by 'B').
3. Text leaf nodes (identified by 'T').

Definition at line 232 of file newgrf_act14.cpp.

## Member Typedef Documentation

## ◆ Span

using AllowedSubtags::Span = std::pair<const AllowedSubtags *, const AllowedSubtags *>

Custom 'span' of subtags.

Required because std::span with an incomplete type is UB.

Definition at line 234 of file newgrf_act14.cpp.

## Field Documentation

## ◆ handler

std::variant<DataHandler, TextHandler, BranchHandler, Span> AllowedSubtags::handler

The handler for this node.

Definition at line 237 of file newgrf_act14.cpp.

## ◆ id

uint32_t AllowedSubtags::id

The identifier for this node.

Definition at line 236 of file newgrf_act14.cpp.

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

- src/newgrf/newgrf_act14.cpp