3 using Vintagestory.API.Common;
4 using Vintagestory.API.Datastructures;
7 public class StatusData : IAttribute {
8 public uint TotalUpdates { get; set; }
9 public uint VoidChunks { get; set; }
10 public uint Delta { get; set; }
11 public uint Max_N, Max_E, Max_S, Max_W;
12 public RunState CurrentState { get; set; }
14 public StatusData(uint totalUpdates, uint voidChunks, uint delta, RunState currently) {
15 TotalUpdates = totalUpdates;
16 VoidChunks = voidChunks;
18 CurrentState = currently;
21 public void FromBytes(BinaryReader stream) {
22 TotalUpdates = stream.ReadUInt32();
23 VoidChunks = stream.ReadUInt32();
24 Delta = stream.ReadUInt32();
25 CurrentState = (RunState) stream.ReadByte();
28 public int GetAttributeId() {
32 public object GetValue() {
36 public void ToBytes(BinaryWriter stream) {
37 stream.Write(TotalUpdates);
38 stream.Write(VoidChunks);
40 stream.Write((byte) CurrentState);
43 public string ToJsonToken() {
44 return $"TotalUpdate:{TotalUpdates}, VoidChunks:{VoidChunks}, Delta:{Delta}";
47 public bool Equals(IWorldAccessor worldForResolve, IAttribute attr) {
48 StatusData other = attr.GetValue() as StatusData;
50 if (this.TotalUpdates == other.TotalUpdates &&
51 this.VoidChunks == other.VoidChunks &&
52 this.Delta == other.Delta &&
53 this.CurrentState == other.CurrentState) {