public RailDejitterBuffer(int capacity, int divisor = 1) { returnList = new List <T>(); this.divisor = divisor; data = new T[capacity / divisor]; latestIdx = -1; tickComparer = Tick.CreateComparer(); }
private IEnumerable <RailCommandUpdate> ProduceCommandUpdates( IEnumerable <RailEntityBase> entities) { // If we have too many entities to fit commands for in a packet, // we want to round-robin sort them to avoid starvation return(entities.Select(e => e as RailEntityClient) .OrderBy(e => e.LastSentCommandTick, Tick.CreateComparer()) .Select(e => RailCommandUpdate.Create(Resource, e, e.OutgoingCommands))); }
public ViewComparer() { comparer = Tick.CreateComparer(); }