Beispiel #1
0
 public RailDejitterBuffer(int capacity, int divisor = 1)
 {
     returnList   = new List <T>();
     this.divisor = divisor;
     data         = new T[capacity / divisor];
     latestIdx    = -1;
     tickComparer = Tick.CreateComparer();
 }
Beispiel #2
0
 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)));
 }
Beispiel #3
0
 public ViewComparer()
 {
     comparer = Tick.CreateComparer();
 }