trimming fat; own files; etc
This commit is contained in:
28
OpenRa.Game/LocalOrderSource.cs
Normal file
28
OpenRa.Game/LocalOrderSource.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
class LocalOrderSource : IOrderSource
|
||||
{
|
||||
Dictionary<int, List<Order>> orders = new Dictionary<int, List<Order>>();
|
||||
|
||||
public List<Order> OrdersForFrame(int currentFrame)
|
||||
{
|
||||
// TODO: prune `orders` based on currentFrame.
|
||||
if (!orders.ContainsKey(currentFrame))
|
||||
return new List<Order>();
|
||||
return orders[currentFrame];
|
||||
}
|
||||
|
||||
public void SendLocalOrders(int localFrame, List<Order> localOrders)
|
||||
{
|
||||
if (localFrame == 0) return;
|
||||
orders[localFrame] = localOrders;
|
||||
}
|
||||
|
||||
public bool IsReadyForFrame(int frameNumber)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user