using System;
using System.Threading.Tasks;
namespace Protocol376Simulator.Interfaces
{
///
/// 定义模拟器的基本接口
///
public interface ISimulator
{
///
/// 启动模拟器
///
/// 是否自动登录
/// 是否自动发送心跳
Task StartAsync(bool autoLogin = false, bool autoHeartbeat = false);
///
/// 停止模拟器
///
Task StopAsync();
///
/// 发送登录消息
///
Task SendLoginMessageAsync();
///
/// 发送心跳消息
///
Task SendHeartbeatMessageAsync();
///
/// 启动心跳发送
///
void StartHeartbeat();
///
/// 停止心跳发送
///
void StopHeartbeat();
///
/// 获取模拟器状态
///
/// 格式化的状态信息字符串
string GetStatus();
///
/// 当状态变更时触发的事件
///
event EventHandler StatusChanged;
///
/// 当接收到消息时触发的事件
///
event EventHandler MessageReceived;
///
/// 模拟器是否已连接
///
bool IsConnected { get; }
///
/// 模拟器是否已登录
///
bool IsLoggedIn { get; }
}
}