/
SimModuleRCS.cs
49 lines (41 loc) · 1.36 KB
/
SimModuleRCS.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
49
#nullable enable
using System.Collections.Generic;
using MechJebLib.Utils;
namespace MechJebLib.Simulations.PartModules
{
public class SimModuleRCS : SimPartModule
{
private static readonly ObjectPool<SimModuleRCS> _pool = new ObjectPool<SimModuleRCS>(New, Clear);
public readonly List<SimPropellant> Propellants = new List<SimPropellant>();
public readonly Dictionary<int, SimFlowMode> PropellantFlowModes = new Dictionary<int, SimFlowMode>();
public readonly Dictionary<int, double> ResourceConsumptions = new Dictionary<int, double>();
public double G;
public double Isp;
public double Thrust;
public bool RcsEnabled;
public override void Dispose()
{
_pool.Release(this);
}
public static SimModuleRCS Borrow(SimPart part)
{
SimModuleRCS clamp = _pool.Borrow();
clamp.Part = part;
return clamp;
}
private static SimModuleRCS New()
{
return new SimModuleRCS();
}
public void Activate()
{
if (StagingEnabled && ModuleIsEnabled)
{
RcsEnabled = true;
}
}
private static void Clear(SimModuleRCS m)
{
}
}
}