56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ActiveProtect.Simulation
|
|
{
|
|
/// <summary>
|
|
/// 仿真管理器接口,定义了仿真管理器的基本功能
|
|
/// </summary>
|
|
public interface ISimulationManager
|
|
{
|
|
/// <summary>
|
|
/// 当前仿真时间
|
|
/// </summary>
|
|
double CurrentTime { get; }
|
|
|
|
/// <summary>
|
|
/// 添加仿真元素
|
|
/// </summary>
|
|
void AddElement(SimulationElement element);
|
|
|
|
/// <summary>
|
|
/// 仿真元素列表
|
|
/// </summary>
|
|
List<SimulationElement> GetElements();
|
|
|
|
/// <summary>
|
|
/// 根据ID获取仿真实体
|
|
/// </summary>
|
|
SimulationElement GetEntityById(string id);
|
|
|
|
/// <summary>
|
|
/// 处理目标被击中事件
|
|
/// </summary>
|
|
void HandleTargetHit();
|
|
|
|
/// <summary>
|
|
/// 发布仿真事件
|
|
/// </summary>
|
|
void PublishEvent(SimulationEvent evt);
|
|
|
|
/// <summary>
|
|
/// 订阅仿真事件
|
|
/// </summary>
|
|
void SubscribeToEvent<T>(Action<T> handler) where T : SimulationEvent;
|
|
|
|
/// <summary>
|
|
/// 取消订阅仿真事件
|
|
/// </summary>
|
|
void UnsubscribeFromEvent<T>(Action<T> handler) where T : SimulationEvent;
|
|
|
|
/// <summary>
|
|
/// 取消所有事件订阅
|
|
/// </summary>
|
|
void UnsubscribeAllEvents(SimulationElement element);
|
|
}
|
|
} |