micromissiles-unity/Assets/Scripts/IADS/IADS.cs

30 lines
767 B
C#
Raw Normal View History

2024-09-12 20:06:47 -07:00
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
using System;
// Integrated Air Defense System
2024-09-13 22:45:25 -07:00
public class IADS : MonoBehaviour {
public enum TargetStatus { UNASSIGNED, ASSIGNED, HIT, DEGRADED, DESTROYED }
2024-09-24 19:24:50 -07:00
// Look up threat status by unique threat ID
2024-09-13 22:45:25 -07:00
public Dictionary<string, TargetStatus> _targetStatusDictionary;
2024-09-24 19:24:50 -07:00
private List<Threat> _threats;
2024-09-13 22:45:25 -07:00
private List<Missile> _missiles;
private List<Vessel> _vessels;
2024-09-24 19:24:50 -07:00
public delegate void RegisterNewTargetDelegate(Threat threat);
2024-09-13 22:45:25 -07:00
public event RegisterNewTargetDelegate OnRegisterNewTarget;
void Start() {
2024-09-24 19:24:50 -07:00
_threats = new List<Threat>();
2024-09-13 22:45:25 -07:00
}
2024-09-24 19:24:50 -07:00
public void RegisterNewTarget(Threat threat) {
_threats.Add(threat);
OnRegisterNewTarget?.Invoke(threat);
2024-09-13 22:45:25 -07:00
}
2024-09-12 20:06:47 -07:00
}