Files
OpenRA/OpenRa.Game/Traits/StoresOre.cs
2010-01-05 12:26:10 +13:00

28 lines
507 B
C#

using System.Collections.Generic;
namespace OpenRa.Game.Traits
{
class StoresOre : IPips
{
readonly Actor self;
public StoresOre(Actor self)
{
this.self = self;
}
public IEnumerable<PipType> GetPips(Actor self)
{
for (int i = 0; i < self.Info.OrePips; i++)
{
if (Game.LocalPlayer.GetSiloFullness() > i * 1.0f / self.Info.OrePips)
{
yield return PipType.Yellow;
continue;
}
yield return PipType.Transparent;
}
}
}
}