10#ifndef GAMELOG_INTERNAL_H
11#define GAMELOG_INTERNAL_H
247 std::vector<std::unique_ptr<LoggedChange>>
change;
Functions to be called to log fundamental changes to the game.
GamelogChangeType
Type of logged change.
@ GRFCompat
Loading compatible GRF.
@ Revision
Changed game revision string.
@ GRFParam
GRF parameter changed.
@ GRFMove
GRF order changed.
@ Mode
Scenario editor x Game, different landscape.
@ None
In savegames, end of list.
@ OldVer
Loaded from savegame without logged data.
GamelogActionType
The actions we log.
@ Setting
Setting changed.
@ Emergency
Emergency savegame.
std::map< GrfID, GRFPresence > GrfIDMapping
A mapping from GrfID to the GRFPresence.
Types related to the landscape.
LandscapeType
Landscape types.
GRFBug
Encountered GRF bugs.
uint32_t GrfID
The unique identifier of a NewGRF.
GameMode
Mode which defines the state of the game.
Information about GRF, used in the game and (part of it) in savegames.
Basic data to distinguish a GRF.
GRFPresence()=default
Create an empty presence.
bool was_missing
Grf was missing during some gameload in the past.
GRFPresence(const GRFConfig *gc)
Create the presence.
const GRFConfig * gc
GRFConfig, if known.
Container for some internal data.
std::vector< LoggedAction > action
The known actions.
Contains information about one logged action that caused at least one logged change.
uint64_t tick
Tick when it happened.
std::vector< std::unique_ptr< LoggedChange > > change
Logged changes in this action.
GamelogActionType at
Type of action.
LoggedChangeEmergencySave()
Create the 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.
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.
LoggedChangeGRFAdd(const GRFIdentifier &ident)
Create a log entry for an added NewGRF.
LoggedChangeGRFAdd()
Constructor for savegame loading.
LoggedChangeGRFBug()
Constructor for savegame loading.
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.
GrfID grfid
ID of problematic GRF.
uint64_t data
additional data
LoggedChangeGRFBug(uint64_t data, GrfID grfid, GRFBug bug)
Create a NewGRF bug log entry.
LoggedChangeGRFChanged(const GRFIdentifier &ident)
Create a log entry for a changed 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.
LoggedChangeGRFChanged()
Constructor for savegame loading.
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.
LoggedChangeGRFMoved(GrfID grfid, int32_t offset)
Create a log entry for a moved NewGRF.
LoggedChangeGRFMoved()
Constructor for savegame loading.
int32_t offset
offset, positive = move down
GrfID grfid
ID of moved GRF.
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.
GrfID grfid
ID of GRF with changed parameters.
LoggedChangeGRFParameterChanged()
Constructor for savegame loading.
LoggedChangeGRFParameterChanged(GrfID grfid)
Create a log entry for a parameter change of a NewGRF.
GrfID grfid
ID of removed GRF.
LoggedChangeGRFRemoved()
Constructor for savegame loading.
LoggedChangeGRFRemoved(GrfID grfid)
Create a log entry for a removed 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.
LandscapeType landscape
landscape (temperate, arctic, ...)
LoggedChangeMode(GameMode mode, LandscapeType landscape)
Create the log for changing the game mode.
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.
GameMode mode
new game mode - Editor x Game
LoggedChangeMode()
Constructor for savegame loading.
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.
LoggedChangeOldVersion(uint32_t type, uint32_t version)
Create the entry.
LoggedChangeOldVersion()
Constructor for savegame loading.
uint32_t type
type of savegame,
uint32_t version
major and minor version OR ttdp version
std::string text
revision string, _openttd_revision
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.
uint16_t slver
_sl_version
LoggedChangeRevision(const std::string &text, uint32_t newgrf, uint16_t slver, uint8_t modified)
Create the new log entry.
LoggedChangeRevision()
Constructor for savegame loading.
uint32_t newgrf
_openttd_newgrf_version
uint8_t modified
_openttd_revision_modified
std::string name
name of the setting
LoggedChangeSettingChanged(const std::string &name, int32_t oldval, int32_t newval)
Create the log entry.
LoggedChangeSettingChanged()
Constructor for savegame loading.
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.
virtual void FormatTo(std::back_insert_iterator< std::string > &output_iterator, GrfIDMapping &grf_names, GamelogActionType action_type)=0
Format the content of this change into the given output.
GamelogChangeType ct
The type of change.
LoggedChange(GamelogChangeType type=GamelogChangeType::None)
Create the log entry.
virtual ~LoggedChange()=default
Ensure the destructor of the sub classes are called as well.