Files
parkan-playground/ResTreeLib/Trf0Element.cs
T

36 lines
1.1 KiB
C#
Raw Permalink Normal View History

2026-05-09 18:39:26 +03:00
namespace ResTreeLib;
2026-02-15 23:44:20 +03:00
2026-05-09 18:39:26 +03:00
// TRF0 node payload (40 bytes).
// Field naming for the first 16 bytes is based on empirical checks over the mission .trf set.
// ResearchCost/ResearchTime look gameplay-related (strong mutual correlation and upgrade-level scaling).
// ViewPosX/ViewPosY behave like 2D layout coordinates; very large Y outliers are mostly unnamed/off-screen nodes.
2026-02-15 23:44:20 +03:00
public record Trf0Element
{
2026-05-09 18:39:26 +03:00
public float ResearchCost; // 0..45 in sample files
public float ResearchTime; // 0..150 in sample files
public float ViewPosX; // 0..80 in sample files
public float ViewPosY; // 0..1500 in sample files
public uint OffsetShortName_TRF7;
public uint OffsetLongName_TRF8;
public uint OffsetHelpText_TRF9;
public uint OffsetDescription_TRFA;
public ushort OffsetAux_TRFB;
2026-02-15 23:44:20 +03:00
public byte TurretType;
public byte MainType;
public byte SubType;
public byte BuildSubSystem;
public byte SizeOfType;
public byte UpgradeLevel;
}
[Flags]
public enum NodeState : byte
{
2026-05-09 18:39:26 +03:00
Hidden = 0,
Available = 1 << 0, // 0x01
2026-02-15 23:44:20 +03:00
Researched = 1 << 1, // 0x02
2026-05-09 18:39:26 +03:00
Active = 1 << 2 // 0x04: if not set, node is disabled
}