Refactor "Missile" -> "Interceptor"
This commit is contained in:
@@ -12,19 +12,19 @@ public class IADS : MonoBehaviour {
|
||||
|
||||
private List<Threat> _threats;
|
||||
|
||||
private List<Missile> _missiles;
|
||||
private List<Interceptor> _interceptors;
|
||||
|
||||
private List<Vessel> _vessels;
|
||||
|
||||
public delegate void RegisterNewTargetDelegate(Threat threat);
|
||||
public event RegisterNewTargetDelegate OnRegisterNewTarget;
|
||||
public delegate void RegisterNewThreatDelegate(Threat threat);
|
||||
public event RegisterNewThreatDelegate OnRegisterNewThreat;
|
||||
|
||||
void Start() {
|
||||
_threats = new List<Threat>();
|
||||
}
|
||||
|
||||
public void RegisterNewTarget(Threat threat) {
|
||||
public void RegisterNewThreat(Threat threat) {
|
||||
_threats.Add(threat);
|
||||
OnRegisterNewTarget?.Invoke(threat);
|
||||
OnRegisterNewThreat?.Invoke(threat);
|
||||
}
|
||||
}
|
||||
@@ -3,23 +3,23 @@ using System.Collections.Generic;
|
||||
|
||||
public class Vessel : MonoBehaviour {
|
||||
[SerializeField]
|
||||
private List<Missile> missileInventory = new List<Missile>();
|
||||
private List<Interceptor> missileInventory = new List<Interceptor>();
|
||||
|
||||
public void AddMissile(Missile missile) {
|
||||
if (missile != null) {
|
||||
missileInventory.Add(missile);
|
||||
public void AddInterceptor(Interceptor interceptor) {
|
||||
if (interceptor != null) {
|
||||
missileInventory.Add(interceptor);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveMissile(Missile missile) {
|
||||
missileInventory.Remove(missile);
|
||||
public void RemoveInterceptor(Interceptor interceptor) {
|
||||
missileInventory.Remove(interceptor);
|
||||
}
|
||||
|
||||
public List<Missile> GetMissileInventory() {
|
||||
return new List<Missile>(missileInventory);
|
||||
public List<Interceptor> GetInterceptorInventory() {
|
||||
return new List<Interceptor>(missileInventory);
|
||||
}
|
||||
|
||||
public int GetMissileCount() {
|
||||
public int GetInterceptorCount() {
|
||||
return missileInventory.Count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user