remove self parameter from IPostRenderSelection.RenderAfterWorld

This commit is contained in:
Chris Forbes
2011-10-23 12:23:15 +13:00
parent b9ac25e044
commit ce8267992a
6 changed files with 30 additions and 12 deletions

View File

@@ -14,22 +14,27 @@ using OpenRA.Graphics;
namespace OpenRA.Traits
{
public class SelectableInfo : TraitInfo<Selectable>
public class SelectableInfo : ITraitInfo
{
public readonly int Priority = 10;
public readonly int[] Bounds = null;
[VoiceReference] public readonly string Voice = null;
public object Create(ActorInitializer init) { return new Selectable(init.self); }
}
public class Selectable : IPostRenderSelection
{
public void RenderAfterWorld (WorldRenderer wr, Actor self)
Actor self;
public Selectable(Actor self) { this.self = self; }
public void RenderAfterWorld(WorldRenderer wr)
{
var bounds = self.Bounds.Value;
var xy = new float2(bounds.Left, bounds.Top);
var Xy = new float2(bounds.Right, bounds.Top);
var xY = new float2(bounds.Left, bounds.Bottom);
wr.DrawSelectionBox(self, Color.White);
DrawHealthBar(self, xy, Xy);