-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRCSController.cs
33 lines (27 loc) · 898 Bytes
/
RCSController.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
using System;
using System.Reflection;
using KRPC.MechJeb.ExtensionMethods;
using KRPC.Service.Attributes;
namespace KRPC.MechJeb {
[KRPCClass(Service = "MechJeb")]
public class RCSController : ComputerModule {
internal new const string MechJebType = "MuMech.MechJebModuleRCSController";
// Fields and methods
private static FieldInfo rcsThrottle;
private static FieldInfo rcsForRotation;
internal static new void InitType(Type type) {
rcsThrottle = type.GetCheckedField("rcsThrottle");
rcsForRotation = type.GetCheckedField("rcsForRotation");
}
[KRPCProperty]
public bool RCSThrottle {
get => (bool)rcsThrottle.GetValue(this.instance);
set => rcsThrottle.SetValue(this.instance, value);
}
[KRPCProperty]
public bool RCSForRotation {
get => (bool)rcsForRotation.GetValue(this.instance);
set => rcsForRotation.SetValue(this.instance, value);
}
}
}