LuaFlowStatistics
Encapsulates statistic data for different parts of the game. In the context of flow statistics, input
and output
describe on which side of the associated GUI the values are shown. Input values are shown on the left side, output values on the right side.
Examples:
- The item production GUI shows "consumption" on the right, thus output
describes the item consumption numbers. The same goes for fluid consumption.
- The kills gui shows "losses" on the right, so output
describes how many of the force's entities were killed by enemies.
- The electric network GUI shows "power consumption" on the left side, so in this case input
describes the power consumption numbers.
LuaFlowStatistics
Gets the total input count for a given prototype.
Sets the total input count for a given prototype.
Gets the total output count for a given prototype.
Sets the total output count for a given prototype.
Gets the flow count value for the given time frame.
Adds a value to this flow statistics.
Reset all the statistics data to 0.
List of input counts indexed by prototype name.
List of output counts indexed by prototype name.
The class name of this object.
get_flow_count
{name,
input,
precision_index,
count}
→ double
Gets the flow count value for the given time frame.
help
()
→ string
All methods and properties that this object supports.
input_counts
:: dictionary[string → uint64 or
double]
[Read]
List of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for the given statistics.
output_counts
:: dictionary[string → uint64 or
double]
[Read]
List of output counts indexed by prototype name. Represents the data that is shown on the right side of the GUI for the given statistics.
force
:: LuaForce
[Read]
The force these statistics belong to or nil
for pollution statistics.
valid
:: boolean
[Read]
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false
. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
object_name
:: string
[Read]
The class name of this object. Available even when valid
is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.