OpenTTD Source 20260711-master-g3fb3006dff
LoggedChangeGRFMoved Struct Reference

A log entry for a NewGRF that was moved. More...

#include <gamelog_internal.h>

Inheritance diagram for LoggedChangeGRFMoved:
LoggedChange

Public Member Functions

 LoggedChangeGRFMoved ()
 Constructor for savegame loading.
 LoggedChangeGRFMoved (GrfID grfid, int32_t offset)
 Create a log entry for a moved NewGRF.
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

GrfID grfid {}
 ID of moved GRF.
int32_t offset = 0
 offset, positive = move down
Data Fields inherited from LoggedChange
GamelogChangeType ct {}
 The type of change.

Detailed Description

A log entry for a NewGRF that was moved.

Definition at line 180 of file gamelog_internal.h.

Constructor & Destructor Documentation

◆ LoggedChangeGRFMoved() [1/2]

LoggedChangeGRFMoved::LoggedChangeGRFMoved ( )
inline

Constructor for savegame loading.

Definition at line 182 of file gamelog_internal.h.

References LoggedChange::LoggedChange().

◆ LoggedChangeGRFMoved() [2/2]

LoggedChangeGRFMoved::LoggedChangeGRFMoved ( GrfID grfid,
int32_t offset )
inline

Create a log entry for a moved NewGRF.

Parameters
grfidThe NewGRF that is moved.
offsetThe amount the NewGRF was moved.

Definition at line 189 of file gamelog_internal.h.

References grfid, LoggedChange::LoggedChange(), and offset.

Member Function Documentation

◆ FormatTo()

void LoggedChangeGRFMoved::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 281 of file gamelog.cpp.

References abs(), AddGrfInfo(), grfid, and offset.

Field Documentation

◆ grfid

GrfID LoggedChangeGRFMoved::grfid {}

ID of moved GRF.

Definition at line 193 of file gamelog_internal.h.

Referenced by FormatTo(), and LoggedChangeGRFMoved().

◆ offset

int32_t LoggedChangeGRFMoved::offset = 0

offset, positive = move down

Definition at line 194 of file gamelog_internal.h.

Referenced by FormatTo(), and LoggedChangeGRFMoved().


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