OpenTTD Source 20260711-master-g3fb3006dff
LoggedChangeSettingChanged Struct Reference

A log entry for changing a setting. More...

#include <gamelog_internal.h>

Inheritance diagram for LoggedChangeSettingChanged:
LoggedChange

Public Member Functions

 LoggedChangeSettingChanged ()
 Constructor for savegame loading.
 LoggedChangeSettingChanged (const std::string &name, int32_t oldval, int32_t newval)
 Create the log entry.
void FormatTo (std::back_insert_iterator< std::string > &output_iterator, GrfIDMapping &grf_names, GamelogActionType action_type) override
 Format the content of this change into the given output.
Public Member Functions inherited from LoggedChange
 LoggedChange (GamelogChangeType type=GamelogChangeType::None)
 Create the log entry.
virtual ~LoggedChange ()=default
 Ensure the destructor of the sub classes are called as well.

Data Fields

std::string name {}
 name of the setting
int32_t oldval = 0
 old value
int32_t newval = 0
 new value
Data Fields inherited from LoggedChange
GamelogChangeType ct {}
 The type of change.

Detailed Description

A log entry for changing a setting.

Definition at line 198 of file gamelog_internal.h.

Constructor & Destructor Documentation

◆ LoggedChangeSettingChanged() [1/2]

LoggedChangeSettingChanged::LoggedChangeSettingChanged ( )
inline

Constructor for savegame loading.

Definition at line 200 of file gamelog_internal.h.

References LoggedChange::LoggedChange().

◆ LoggedChangeSettingChanged() [2/2]

LoggedChangeSettingChanged::LoggedChangeSettingChanged ( const std::string & name,
int32_t oldval,
int32_t newval )
inline

Create the log entry.

Parameters
nameThe name of the setting.
oldvalThe value before the change.
newvalThe value after the change.

Definition at line 208 of file gamelog_internal.h.

References LoggedChange::LoggedChange(), name, newval, and oldval.

Member Function Documentation

◆ FormatTo()

void LoggedChangeSettingChanged::FormatTo ( std::back_insert_iterator< std::string > & output_iterator,
GrfIDMapping & grf_names,
GamelogActionType action_type )
overridevirtual

Format the content of this change into the given output.

Parameters
output_iteratorDestination of the formatted content.
grf_namesCache/mapping of names of NewGRFs seen in the logs.
action_typeThe context in which this method was called.

Implements LoggedChange.

Definition at line 223 of file gamelog.cpp.

References name, newval, and oldval.

Field Documentation

◆ name

std::string LoggedChangeSettingChanged::name {}

name of the setting

Definition at line 212 of file gamelog_internal.h.

Referenced by FormatTo(), and LoggedChangeSettingChanged().

◆ newval

int32_t LoggedChangeSettingChanged::newval = 0

new value

Definition at line 214 of file gamelog_internal.h.

Referenced by FormatTo(), and LoggedChangeSettingChanged().

◆ oldval

int32_t LoggedChangeSettingChanged::oldval = 0

old value

Definition at line 213 of file gamelog_internal.h.

Referenced by FormatTo(), and LoggedChangeSettingChanged().


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