Skip to content

Commit

Permalink
Add CGameCtnBlockInfo.Selection
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 committed Jan 20, 2025
1 parent 9ae459b commit 25a8c62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 6 additions & 1 deletion Src/GBX.NET/Engines/Game/CGameCtnBlockInfo.chunkl
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,9 @@ enum EMultiDir
OpposedDirOnly
PerpendicularDirsOnly
NextDirOnly
PreviousDirOnly
PreviousDirOnly

enum ESelection
Random
Obsolete
AutoRotate
14 changes: 9 additions & 5 deletions Src/GBX.NET/Engines/Game/CGameCtnBlockInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ namespace GBX.NET.Engines.Game;

public partial class CGameCtnBlockInfo
{
public ESelection Selection { get; set; }

private CGameCtnBlockInfoClassic? pillar;
[AppliedWithChunk<Chunk0304E005>]
public CGameCtnBlockInfoClassic? Pillar { get => pillarFile?.GetNode(ref pillar) ?? pillar; set => pillar = value; }
private GbxRefTableFile? pillarFile;
public CGameCtnBlockInfoClassic? Pillar { get => pillar; set => pillar = value; }

public GbxRefTableFile? PillarFile { get => pillarFile; set => pillarFile = value; }
public CGameCtnBlockInfoClassic? GetPillar(GbxReadSettings settings = default, bool exceptions = false) => pillarFile?.GetNode(ref pillar, settings, exceptions) ?? pillar;

private CGameCtnBlockUnitInfo[]? groundBlockUnitInfos;
public CGameCtnBlockUnitInfo[]? GroundBlockUnitInfos { get => groundBlockUnitInfos; set => groundBlockUnitInfos = value; }

Expand Down Expand Up @@ -38,7 +43,6 @@ public partial class Chunk0304E005
public int U02;
public int U03;
public int U04;
public int U05;
public int U06;
public byte U07;
public int U08;
Expand All @@ -53,7 +57,7 @@ public override void Read(CGameCtnBlockInfo n, GbxReader r)
U03 = r.ReadInt32(); // always 0?
U04 = r.ReadInt32(); // always 0?
n.isPillar = r.ReadBoolean();
U05 = r.ReadInt32(); // always 0?
n.Selection = (ESelection)r.ReadInt32();
U06 = r.ReadInt32(); // always 0?
//

Expand Down Expand Up @@ -88,7 +92,7 @@ public override void Write(CGameCtnBlockInfo n, GbxWriter w)
w.Write(U03);
w.Write(U04);
w.Write(n.isPillar);
w.Write(U05);
w.Write((int)n.Selection);
w.Write(U06);
//

Expand Down

0 comments on commit 25a8c62

Please sign in to comment.