54 lines
1.9 KiB
C#
54 lines
1.9 KiB
C#
using ActiveProtect.SimulationEnvironment;
|
|
|
|
namespace ActiveProtect.Models
|
|
{
|
|
public class LaserSemiActiveGuidedMissile : Missile
|
|
{
|
|
// 激光半主动制导导弹的特殊属性
|
|
public bool IsLaserLocked { get; private set; } = false;
|
|
|
|
public LaserSemiActiveGuidedMissile(
|
|
string id,
|
|
Vector3D position,
|
|
Orientation orientation,
|
|
double initialSpeed,
|
|
double maxSpeed,
|
|
string targetId,
|
|
double maxFlightTime,
|
|
double maxFlightDistance,
|
|
MissileDistanceParams distanceParams,
|
|
FlightStageConfig stageConfig,
|
|
ISimulationManager simulationManager,
|
|
double thrustAcceleration,
|
|
double maxEngineBurnTime,
|
|
double maxAcceleration,
|
|
double proportionalNavigationCoefficient)
|
|
: base(id, position, orientation, initialSpeed, maxSpeed, targetId, maxFlightTime, maxFlightDistance,
|
|
distanceParams, stageConfig, simulationManager, thrustAcceleration, maxEngineBurnTime, maxAcceleration, proportionalNavigationCoefficient)
|
|
{
|
|
Type = MissileType.SemiActiveLaserGuidance;
|
|
}
|
|
|
|
public override void Update(double deltaTime)
|
|
{
|
|
base.Update(deltaTime);
|
|
|
|
// 激光半主动制导导弹的特殊更新逻辑
|
|
UpdateLaserLock();
|
|
}
|
|
|
|
private void UpdateLaserLock()
|
|
{
|
|
// 这里实现激光锁定逻辑
|
|
// 例如,根据距离和其他因素来决定是否锁定目标
|
|
IsLaserLocked = DistanceToTarget < DistanceParams.TerminalGuidanceDistance;
|
|
}
|
|
|
|
public override string GetStatus()
|
|
{
|
|
return base.GetStatus().Replace("导弹", "激光半主动制导导弹") +
|
|
$"\n 激光锁定: {(IsLaserLocked ? "是" : "否")}";
|
|
}
|
|
}
|
|
}
|