Game.UI.InGame.TaxResourceInfo
Assembly:
Assembly-CSharp (inferred — part of the game's managed assemblies)
Namespace:
Game.UI.InGame
Type:
struct
Base:
System.ValueType
Implements: Colossal.UI.Binding.IJsonWritable
Summary:
Represents a small data container used to describe a tax-related resource for UI/serialization. It holds an identifier and an icon name and knows how to write itself to a JSON writer via the IJsonWritable interface. This struct is mutable (public fields) and intended for simple transfer/serialization of tax resource metadata used by the in-game UI.
Fields
-
public string m_ID
Identifier for the tax resource. Written to JSON under the property name "id". Example value: "res_01". -
public string m_Icon
Icon name (or key) for the tax resource. Written to JSON under the property name "icon". Example value: "icon_tax".
Properties
- None.
Constructors
public TaxResourceInfo()
Implicit parameterless constructor provided by the C# struct type. Initializes fields to null by default. You can construct instances using an object initializer: var info = new TaxResourceInfo { m_ID = "id", m_Icon = "icon" };
Methods
public void Write(Colossal.UI.Binding.IJsonWriter writer)
: System.Void
Serializes this instance to the provided IJsonWriter. The JSON structure produced:
{
(type wrapper) "taxation.TaxResourceInfo": {
"id":
Implementation details: - Calls writer.TypeBegin("taxation.TaxResourceInfo") - Writes the "id" property with m_ID - Writes the "icon" property with m_Icon - Calls writer.TypeEnd()
This method relies on the IJsonWriter implementation used by the game's UI binding system.
Usage Example
// Create and populate
var info = new TaxResourceInfo {
m_ID = "municipal_tax",
m_Icon = "icon_tax_municipal"
};
// Serialize using an existing IJsonWriter instance provided by the UI system:
IJsonWriter writer = /* obtain writer from UI binding context */;
info.Write(writer);
// Or pass this struct into API that expects IJsonWritable for UI serialization.
Notes for modders: - Fields are public and mutable — set them directly before calling Write or passing the struct to UI serialization routines. - The exact IJsonWriter implementation is part of Colossal.UI.Binding and provided by the game's UI framework; obtain it from the context where UI serialization is performed.