2021-11-26 19:33:56 +00:00

40 lines
633 B
C#

using QuantumUNET.Transport;
namespace QSB.Utility.VariableSync
{
public class BoolVariableSyncer : BaseVariableSyncer
{
public VariableReference<bool> FloatToSync;
public override void WriteData(QNetworkWriter writer)
{
if (FloatToSync == null)
{
writer.Write(0f);
}
else
{
writer.Write(FloatToSync.Value);
}
}
public override void ReadData(QNetworkReader writer)
{
if (FloatToSync == null)
{
writer.ReadSingle();
}
else
{
FloatToSync.Value = writer.ReadBoolean();
}
}
public override bool HasChanged()
{
// TODO - do this!!
return true;
}
}
}