Files
crystall-punk-14/Content.Server/Radio/RadioReceiveEvent.cs

42 lines
1.1 KiB
C#
Raw Normal View History

2022-11-15 17:09:27 +13:00
using Content.Shared.Chat;
using Content.Shared.Radio;
namespace Content.Server.Radio;
2023-03-24 03:02:41 +03:00
[ByRefEvent]
public struct RadioReceiveEvent
2022-11-15 17:09:27 +13:00
{
public readonly string Message;
2023-03-24 03:02:41 +03:00
public readonly EntityUid MessageSource;
2022-11-15 17:09:27 +13:00
public readonly RadioChannelPrototype Channel;
public readonly MsgChatMessage ChatMsg;
2023-03-24 03:02:41 +03:00
public RadioReceiveEvent(string message, EntityUid messageSource, RadioChannelPrototype channel, MsgChatMessage chatMsg)
2022-11-15 17:09:27 +13:00
{
Message = message;
2023-03-24 03:02:41 +03:00
MessageSource = messageSource;
2022-11-15 17:09:27 +13:00
Channel = channel;
ChatMsg = chatMsg;
}
}
2023-03-24 03:02:41 +03:00
/// <summary>
/// Use this event to cancel sending messages by doing various checks (e.g. range)
/// </summary>
[ByRefEvent]
public struct RadioReceiveAttemptEvent
2022-11-15 17:09:27 +13:00
{
public readonly RadioChannelPrototype Channel;
2023-03-24 03:02:41 +03:00
public readonly EntityUid RadioSource;
public readonly EntityUid RadioReceiver;
2022-11-15 17:09:27 +13:00
2023-03-24 03:02:41 +03:00
public bool Cancelled = false;
public RadioReceiveAttemptEvent(RadioChannelPrototype channel, EntityUid radioSource, EntityUid radioReceiver)
2022-11-15 17:09:27 +13:00
{
Channel = channel;
RadioSource = radioSource;
2023-03-24 03:02:41 +03:00
RadioReceiver = radioReceiver;
2022-11-15 17:09:27 +13:00
}
}