shuffling

This commit is contained in:
Chris Forbes
2010-01-02 12:22:34 +13:00
parent acacd99a71
commit a2a00ae599
17 changed files with 34 additions and 36 deletions

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
namespace OpenRa.Game.Orders
{
class LocalOrderSource : IOrderSource
{
Dictionary<int, List<Order>> orders = new Dictionary<int, List<Order>>();
public List<Order> OrdersForFrame(int currentFrame)
{
if (!orders.ContainsKey(currentFrame))
return new List<Order>();
var result = orders[currentFrame];
orders.Remove(currentFrame);
return result;
}
public void SendLocalOrders(int localFrame, List<Order> localOrders)
{
if (localFrame == 0) return;
orders[localFrame] = localOrders;
}
public bool IsReadyForFrame(int frameNumber)
{
return true;
}
}
}