Files
OpenRA/OpenRa.Game/Traits/StoresOre.cs
2009-12-21 19:26:22 -08:00

28 lines
497 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()
{
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;
}
}
}
}