mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
40 lines
637 B
C#
40 lines
637 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(false);
|
|
}
|
|
else
|
|
{
|
|
writer.Write(FloatToSync.Value);
|
|
}
|
|
}
|
|
|
|
public override void ReadData(QNetworkReader writer)
|
|
{
|
|
if (FloatToSync == null)
|
|
{
|
|
writer.ReadBoolean();
|
|
}
|
|
else
|
|
{
|
|
FloatToSync.Value = writer.ReadBoolean();
|
|
}
|
|
}
|
|
|
|
public override bool HasChanged()
|
|
{
|
|
// TODO - do this!!
|
|
return true;
|
|
}
|
|
}
|
|
}
|