Skip to content

Commit

Permalink
add SByte4
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Mar 11, 2016
1 parent f0ae629 commit 0b9dfb9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions Common/Common.csproj
Expand Up @@ -78,6 +78,7 @@
<Compile Include="Game\Messages\ChangeDatas.cs" />
<Compile Include="Game\TerrainGen\RiverGen.cs" />
<Compile Include="Lib\BufferPool.cs" />
<Compile Include="Lib\DataTypes\SByte4.cs" />
<Compile Include="Lib\DataTypes\Byte4.cs" />
<Compile Include="Lib\DataTypes\Containment.cs" />
<Compile Include="Lib\DataTypes\EnumBitMask.cs" />
Expand Down
29 changes: 29 additions & 0 deletions Common/Lib/DataTypes/SByte4.cs
@@ -0,0 +1,29 @@
using System.Runtime.InteropServices;

namespace Dwarrowdelf
{
[StructLayout(LayoutKind.Sequential, Size = 4)]
public struct SByte4
{
public sbyte X;
public sbyte Y;
public sbyte Z;
public sbyte W;

public SByte4(sbyte x, sbyte y, sbyte z, sbyte w)
{
this.X = x;
this.Y = y;
this.Z = z;
this.W = w;
}

public SByte4(int x, int y, int z, int w)
{
this.X = (sbyte)x;
this.Y = (sbyte)y;
this.Z = (sbyte)z;
this.W = (sbyte)w;
}
}
}

0 comments on commit 0b9dfb9

Please sign in to comment.