You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
8 months ago
|
using System;
|
||
|
|
||
|
namespace AX.MessageSystem
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 通信系统所用的消息接口,可在游戏内进行通知。
|
||
|
/// </summary>
|
||
|
public interface IMessage
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 表示消息的类型。其实类似于消息的 ID,用于表示哪种消息。
|
||
|
/// </summary>
|
||
|
/// <remarks>
|
||
|
/// 为什么不用整型呢?诚然用整型分发消息性能更高,内存占用更低,但数字不易阅读和理解。
|
||
|
/// 字符串类型既可以任意表达,又容易阅读和理解。
|
||
|
/// </remarks>
|
||
|
string Type { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示消息的分发渠道。
|
||
|
/// </summary>
|
||
|
string[] Filters { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示消息的发送方。
|
||
|
/// </summary>
|
||
|
object Sender { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示延迟处理消息的时间,按秒计。
|
||
|
/// </summary>
|
||
|
float Delay { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示消息的附加数据。
|
||
|
/// </summary>
|
||
|
object Data { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示消息是否已发送。
|
||
|
/// </summary>
|
||
|
bool IsSent { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表示消息是否已处理过。
|
||
|
/// </summary>
|
||
|
bool IsHandled { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// 清空消息。
|
||
|
/// </summary>
|
||
|
void Clear();
|
||
|
}
|
||
|
}
|