mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-15 02:26:44 -04:00
Added FSO.Files for use with the API server
Don't ask me. FreeSO is the prime example of dependency hell.
This commit is contained in:
parent
4b5e584eeb
commit
8fec258215
104 changed files with 14653 additions and 163 deletions
45
server/tso.files/RC/DGRPRCParams.cs
Executable file
45
server/tso.files/RC/DGRPRCParams.cs
Executable file
|
@ -0,0 +1,45 @@
|
|||
using FSO.Files.Utils;
|
||||
|
||||
namespace FSO.Files.RC
|
||||
{
|
||||
public class DGRPRCParams
|
||||
{
|
||||
public bool[] Rotations = new bool[] { true, true, true, true };
|
||||
public bool DoorFix; //depending on subtile, disable certain rotations to fix door.
|
||||
public bool CounterFix; //extrapolate z on sides of counter to the edge of the tile.
|
||||
|
||||
public int StartDGRP;
|
||||
public int EndDGRP;
|
||||
public bool BlenderTweak;
|
||||
public bool Simplify = true;
|
||||
|
||||
public bool InRange(int dgrp)
|
||||
{
|
||||
return ((StartDGRP == EndDGRP && EndDGRP == 0) || (dgrp >= StartDGRP && dgrp <= EndDGRP));
|
||||
}
|
||||
|
||||
public DGRPRCParams() { }
|
||||
public DGRPRCParams(IoBuffer io, int version)
|
||||
{
|
||||
Rotations = new bool[4];
|
||||
for (int i = 0; i < 4; i++) Rotations[i] = io.ReadByte() > 0;
|
||||
DoorFix = io.ReadByte() > 0;
|
||||
CounterFix = io.ReadByte() > 0;
|
||||
StartDGRP = io.ReadInt32();
|
||||
EndDGRP = io.ReadInt32();
|
||||
BlenderTweak = io.ReadByte() > 0;
|
||||
Simplify = io.ReadByte() > 0;
|
||||
}
|
||||
|
||||
public void Save(IoWriter io)
|
||||
{
|
||||
foreach (var rotation in Rotations) io.WriteByte((byte)(rotation ? 1 : 0));
|
||||
io.WriteByte((byte)(DoorFix ? 1 : 0));
|
||||
io.WriteByte((byte)(CounterFix ? 1 : 0));
|
||||
io.WriteInt32(StartDGRP);
|
||||
io.WriteInt32(EndDGRP);
|
||||
io.WriteByte((byte)(BlenderTweak ? 1 : 0));
|
||||
io.WriteByte((byte)(Simplify ? 1 : 0));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue