forked from jrossignol/ContractConfigurator
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathRemoteTechParameter.cs
48 lines (43 loc) · 1.33 KB
/
RemoteTechParameter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using ContractConfigurator.Parameters;
using Contracts;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using UnityEngine;
using ContractConfigurator;
using RemoteTech;
namespace ContractConfigurator.RemoteTech
{
public abstract class RemoteTechParameter : VesselParameter
{
public RemoteTechParameter(string title)
: base(title)
{
}
protected override void OnRegister()
{
base.OnRegister();
RemoteTechAssistant.OnRemoteTechUpdate.Add(OnRemoteTechUpdate);
}
protected override void OnUnregister()
{
base.OnUnregister();
RemoteTechAssistant.OnRemoteTechUpdate.Remove(OnRemoteTechUpdate);
}
protected void OnRemoteTechUpdate(VesselSatellite s)
{
CheckVessel(s.parentVessel);
}
/// <summary>
/// Check for whether we are in a valid state to check the given vessel. Checks if the
/// RemoteTech logic is initialized.
/// </summary>
/// <param name="vessel">The vessel - ignored.</param>
/// <returns>True only if RemoteTech is initialized.</returns>
protected override bool CanCheckVesselMeetsCondition(Vessel vessel)
{
return (RTCore.Instance != null);
}
}
}