Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
virusek20 committed Mar 30, 2019
2 parents ba7d2bd + 08168a3 commit 472edbb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SatisfactorySaveParser/PropertyTypes/StructProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ private static IStructData ParseStructData(BinaryReader reader, string type)
{
case "LinearColor":
return new LinearColor(reader);
case "Color":
return new Color(reader);
case "Rotator":
return new Rotator(reader);
case "Vector":
Expand Down
32 changes: 32 additions & 0 deletions SatisfactorySaveParser/PropertyTypes/Structs/Color.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.IO;

namespace SatisfactorySaveParser.PropertyTypes.Structs
{
public class Color : IStructData
{
public byte R { get; set; }
public byte G { get; set; }
public byte B { get; set; }
public byte A { get; set; }

public int SerializedLength => 4;
public string Type => "Color";

public Color(BinaryReader reader)
{
R = reader.ReadByte();
G = reader.ReadByte();
B = reader.ReadByte();
A = reader.ReadByte();
}

public void Serialize(BinaryWriter writer)
{
writer.Write(R);
writer.Write(G);
writer.Write(B);
writer.Write(A);
}
}
}
1 change: 1 addition & 0 deletions SatisfactorySaveParser/SatisfactorySaveParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<Compile Include="PropertyTypes\Structs\DynamicStructData.cs" />
<Compile Include="PropertyTypes\Structs\InventoryItem.cs" />
<Compile Include="PropertyTypes\Structs\IStructData.cs" />
<Compile Include="PropertyTypes\Structs\Color.cs" />
<Compile Include="PropertyTypes\Structs\LinearColor.cs" />
<Compile Include="PropertyTypes\Structs\Quat.cs" />
<Compile Include="PropertyTypes\Structs\RailroadTrackPosition.cs" />
Expand Down

0 comments on commit 472edbb

Please sign in to comment.