Harvester uses pips to show load

This commit is contained in:
unknown
2009-12-18 15:19:01 -08:00
19 changed files with 149 additions and 67 deletions

View File

@@ -1,6 +1,7 @@
namespace OpenRa.Game.Traits
using System.Drawing;
namespace OpenRa.Game.Traits
{
class Harvester : IOrder
class Harvester : IOrder, IPips
{
public int oreCarried = 0; /* sum of these must not exceed capacity */
public int gemsCarried = 0;
@@ -53,5 +54,14 @@
self.QueueActivity( new Traits.Activities.DeliverOre( order.TargetActor ) );
}
}
public Color GetBorderColor() { return Color.Black; }
public int GetPipCount() { return 7; }
public Color GetColorForPip(int index)
{
if ((oreCarried + gemsCarried)*1.0f/Rules.General.BailCount* GetPipCount() < index + 1)
return Color.Transparent;
return Color.LimeGreen;
}
}
}