-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlateReturnControllerAuxMessage.cs
55 lines (49 loc) · 1.73 KB
/
PlateReturnControllerAuxMessage.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
50
51
52
53
54
55
using BitStream;
using System.Collections.Generic;
using Team17.Online.Multiplayer.Messaging;
namespace SuperchargedPatch.AlteredComponents
{
public class PlateReturnControllerAuxMessage : AuxMessageBase
{
public override AuxEntityType GetAuxEntityType()
{
return AuxEntityType.PlateReturnControllerAux;
}
public override void Serialise(BitStreamWriter writer)
{
writer.Write((byte)type, 8);
if (type == PlateReturnControllerAuxMessageType.PlateDelivered)
{
m_plateReturnStation.Serialise(writer);
writer.Write(m_timeToReturn);
} else
{
writer.Write((uint)indicesToRemove.Count, 32);
foreach (var index in indicesToRemove)
{
writer.Write((uint)index, 32);
}
}
}
public void InitializePlateDelivered(uint plateReturnStation, float timeToReturn)
{
type = PlateReturnControllerAuxMessageType.PlateDelivered;
m_plateReturnStation.m_uEntityID = plateReturnStation;
m_timeToReturn = timeToReturn;
}
public void InitializeRemovePlates(List<int> indicesToRemove)
{
type = PlateReturnControllerAuxMessageType.RemovePlates;
this.indicesToRemove = indicesToRemove;
}
public PlateReturnControllerAuxMessageType type;
public EntityMessageHeader m_plateReturnStation = new EntityMessageHeader();
public float m_timeToReturn;
public List<int> indicesToRemove;
}
public enum PlateReturnControllerAuxMessageType : byte
{
PlateDelivered,
RemovePlates,
}
}