OpenTTD
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
IConsoleLine Struct Reference

Container for a single line of console output. More...

Public Member Functions

 IConsoleLine (char *buffer, TextColour colour)
 Initialize the console line.
 ~IConsoleLine ()
 Clear this console line and any further ones.

Static Public Member Functions

static const IConsoleLineGet (uint index)
 Get the index-ed item in the list.
static bool Truncate ()
 Truncate the list removing everything older than/more than the amount as specified in the config file.
static void Reset ()
 Reset the complete console line backlog.

Data Fields

IConsoleLineprevious
 The previous console message.
char * buffer
 The data to store.
TextColour colour
 The colour of the line.
uint16 time
 The amount of time the line is in the backlog.

Static Public Attributes

static IConsoleLinefront = NULL
 The front of the console backlog buffer.
static int size = 0
 The amount of items in the backlog.

Detailed Description

Container for a single line of console output.

Definition at line 40 of file console_gui.cpp.

Constructor & Destructor Documentation

IConsoleLine::IConsoleLine ( char *  buffer,
TextColour  colour 
)
inline

Initialize the console line.

Parameters
bufferthe data to print.
colourthe colour of the line.

Definition at line 54 of file console_gui.cpp.

References front, and size.

Member Function Documentation

static bool IConsoleLine::Truncate ( )
inlinestatic

Truncate the list removing everything older than/more than the amount as specified in the config file.

As a side effect also increase the time the other lines have been in the list.

Returns
true if and only if items got removed.

Definition at line 96 of file console_gui.cpp.

References _settings_client, GUISettings::console_backlog_length, GUISettings::console_backlog_timeout, front, ClientSettings::gui, MAX_UVALUE, previous, and time.

Referenced by IConsoleWindow::OnHundredthTick().


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