quantum-space-buddies/QSB/ClientServerStateSync/Messages/ServerStateMessage.cs
2022-03-02 19:46:33 -08:00

15 lines
432 B
C#

using QSB.Messaging;
namespace QSB.ClientServerStateSync.Messages;
/// <summary>
/// sets the state both locally and remotely
/// </summary>
internal class ServerStateMessage : QSBMessage<ServerState>
{
public ServerStateMessage(ServerState state) => Data = state;
public override void OnReceiveLocal() => OnReceiveRemote();
public override void OnReceiveRemote()
=> ServerStateManager.Instance.ChangeServerState(Data);
}