quantum-space-buddies/QSB/Player/Events/PlayerStateMessage.cs

28 lines
664 B
C#
Raw Normal View History

2020-12-14 16:28:03 +00:00
using QSB.Messaging;
using QuantumUNET.Transport;
2020-11-03 21:33:48 +00:00
namespace QSB.Player.Events
{
2020-12-02 21:23:01 +00:00
public class PlayerStateMessage : PlayerMessage
{
public string PlayerName { get; set; }
public bool PlayerReady { get; set; }
public State PlayerState { get; set; }
2020-12-11 22:42:21 +00:00
2020-12-23 12:58:45 +00:00
public override void Deserialize(QNetworkReader reader)
2020-12-02 21:23:01 +00:00
{
base.Deserialize(reader);
PlayerName = reader.ReadString();
PlayerReady = reader.ReadBoolean();
PlayerState = (State)reader.ReadInt32();
}
2020-12-23 12:58:45 +00:00
public override void Serialize(QNetworkWriter writer)
2020-12-02 21:23:01 +00:00
{
base.Serialize(writer);
writer.Write(PlayerName);
writer.Write(PlayerReady);
writer.Write((int)PlayerState);
}
}
2020-12-03 08:28:05 +00:00
}