StyleCop clean FrameData
This commit is contained in:
@@ -24,15 +24,15 @@ namespace OpenRA.Network
|
||||
readonly Dictionary<int, int> clientQuitTimes = new Dictionary<int, int>();
|
||||
readonly Dictionary<int, Dictionary<int, byte[]>> framePackets = new Dictionary<int, Dictionary<int, byte[]>>();
|
||||
|
||||
public IEnumerable<int> ClientsPlayingInFrame( int frame )
|
||||
public IEnumerable<int> ClientsPlayingInFrame(int frame)
|
||||
{
|
||||
return clientQuitTimes
|
||||
.Where( x => frame <= x.Value )
|
||||
.Select( x => x.Key )
|
||||
.OrderBy( x => x );
|
||||
.Where(x => frame <= x.Value)
|
||||
.Select(x => x.Key)
|
||||
.OrderBy(x => x);
|
||||
}
|
||||
|
||||
public void ClientQuit( int clientId, int lastClientFrame )
|
||||
public void ClientQuit(int clientId, int lastClientFrame)
|
||||
{
|
||||
if (lastClientFrame == -1)
|
||||
lastClientFrame = framePackets
|
||||
@@ -42,10 +42,10 @@ namespace OpenRA.Network
|
||||
clientQuitTimes[clientId] = lastClientFrame;
|
||||
}
|
||||
|
||||
public void AddFrameOrders( int clientId, int frame, byte[] orders )
|
||||
public void AddFrameOrders(int clientId, int frame, byte[] orders)
|
||||
{
|
||||
var frameData = framePackets.GetOrAdd( frame );
|
||||
frameData.Add( clientId, orders );
|
||||
var frameData = framePackets.GetOrAdd(frame);
|
||||
frameData.Add(clientId, orders);
|
||||
}
|
||||
|
||||
public bool IsReadyForFrame(int frame)
|
||||
@@ -60,16 +60,16 @@ namespace OpenRA.Network
|
||||
.Where(client => !frameData.ContainsKey(client));
|
||||
}
|
||||
|
||||
public IEnumerable<ClientOrder> OrdersForFrame( World world, int frame )
|
||||
public IEnumerable<ClientOrder> OrdersForFrame(World world, int frame)
|
||||
{
|
||||
var frameData = framePackets[ frame ];
|
||||
var clientData = ClientsPlayingInFrame( frame )
|
||||
.ToDictionary( k => k, v => frameData[ v ] );
|
||||
var frameData = framePackets[frame];
|
||||
var clientData = ClientsPlayingInFrame(frame)
|
||||
.ToDictionary(k => k, v => frameData[v]);
|
||||
|
||||
return clientData
|
||||
.SelectMany( x => x.Value
|
||||
.ToOrderList( world )
|
||||
.Select( o => new ClientOrder { Client = x.Key, Order = o } ) );
|
||||
.SelectMany(x => x.Value
|
||||
.ToOrderList(world)
|
||||
.Select(o => new ClientOrder { Client = x.Key, Order = o }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user