Ore pips on refinery and silo

This commit is contained in:
Paul Chote
2009-12-21 19:13:54 -08:00
parent f20ecc8a5d
commit 0c79363dcc
5 changed files with 37 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
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()
{
if (self.Info.OrePips == 0) yield break;
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;
}
}
}
}