Update QSBEvent.cs

This commit is contained in:
Mister_Nebula 2020-11-11 17:20:26 +00:00
parent 521d70255d
commit edb76722f3

View File

@ -5,10 +5,6 @@ using UnityEngine.Networking;
namespace QSB.EventsCore
{
/// <summary>
/// Abstract class that handles all event code.
/// </summary>
/// <typeparam name="T">The message type to use.</typeparam>
public abstract class QSBEvent<T> : IQSBEvent where T : PlayerMessage, new()
{
public abstract EventType Type { get; }
@ -22,36 +18,18 @@ namespace QSB.EventsCore
_eventHandler.OnServerReceiveMessage += OnServerReceive;
}
/// <summary>
/// Called to set up the activators for the event.
/// </summary>
public abstract void SetupListener();
/// <summary>
/// Called to remove all set up activators.
/// </summary>
public abstract void CloseListener();
/// <summary>
/// Called on every client that didn't send the event.
/// </summary>
/// <param name="message"></param>
public virtual void OnReceiveRemote(T message)
{
}
/// <summary>
/// Called on the client that sent the event.
/// </summary>
/// <param name="message"></param>
public virtual void OnReceiveLocal(T message)
{
}
/// <summary>
/// Called on the server.
/// </summary>
/// <param name="message"></param>
public virtual void OnServerReceive(T message)
{
_eventHandler.SendToAll(message);