4 using Vintagestory.API.MathTools;
8 public struct ColumnCounter
10 public bool NewOrLoaded;
11 public byte[] EditTally;
13 public uint WeightedSum
16 {//TODO: Rank deduction for lower chunks
17 return ( uint )(EditTally.Sum(ed => ed)) + (NewOrLoaded ? 100u : 0u);
21 public ColumnCounter(int chunkSize)
24 EditTally = new byte[chunkSize];
27 public ColumnCounter(int chunkSize, bool editLoaded)
29 NewOrLoaded = editLoaded;
30 EditTally = new byte[chunkSize];
33 public ColumnCounter(int chunkSize, bool editLoaded, Vec3i chunkCoord)
35 int chunkY = chunkCoord.Y % chunkSize;
37 NewOrLoaded = editLoaded;
38 EditTally = new byte[chunkSize];
43 public ColumnCounter Update(Vec3i chunkCoord, int chunkSize)
45 int chunkY = chunkCoord.Y % chunkSize;
51 public override string ToString( )
53 return $"{(NewOrLoaded?'N':'O')} W:{WeightedSum}";