3 using Vintagestory.API.Common;
4 using Vintagestory.API.Datastructures;
8 public class StatusData : IAttribute
10 public uint TotalUpdates { get; set; }
11 public uint VoidChunks { get; set; }
12 public uint Delta { get; set; }
13 public uint Max_N, Max_E, Max_S, Max_W;
14 public RunState CurrentState { get; set; }
16 public StatusData(uint totalUpdates, uint voidChunks, uint delta, RunState currently )
18 TotalUpdates = totalUpdates;
19 VoidChunks = voidChunks;
21 CurrentState = currently;
24 public void FromBytes(BinaryReader stream)
26 TotalUpdates = stream.ReadUInt32( );
27 VoidChunks = stream.ReadUInt32( );
28 Delta = stream.ReadUInt32( );
29 CurrentState = ( RunState )stream.ReadByte( );
32 public int GetAttributeId( )
37 public object GetValue( )
42 public void ToBytes(BinaryWriter stream)
44 stream.Write(TotalUpdates);
45 stream.Write(VoidChunks);
47 stream.Write((byte)CurrentState);
50 public string ToJsonToken( )
52 return $"TotalUpdate:{TotalUpdates}, VoidChunks:{VoidChunks}, Delta:{Delta}";
55 public bool Equals(IWorldAccessor worldForResolve, IAttribute attr)
57 StatusData other = attr.GetValue( ) as StatusData;
59 if (this.TotalUpdates == other.TotalUpdates &&
60 this.VoidChunks == other.VoidChunks &&
61 this.Delta == other.Delta &&
62 this.CurrentState == other.CurrentState) {