format RenderSimple

This commit is contained in:
Chris Forbes
2011-05-30 21:32:54 +12:00
parent 61cde675ea
commit 368468e323
2 changed files with 34 additions and 26 deletions

View File

@@ -35,7 +35,12 @@ namespace OpenRA.Traits
public abstract class RenderSimple : IRender, ITick
{
public Dictionary<string, AnimationWithOffset> anims = new Dictionary<string, AnimationWithOffset>();
public Animation anim { get { return anims[""].Animation; } protected set { anims[""].Animation = value; } }
public Animation anim
{
get { return anims[""].Animation; }
protected set { anims[""].Animation = value; }
}
public static string GetImage(ActorInfo actor, string Tileset)
{
@@ -58,6 +63,7 @@ namespace OpenRA.Traits
}
RenderSimpleInfo Info;
public RenderSimple(Actor self, Func<int> baseFacing)
{
anims.Add("", new Animation(GetImage(self), baseFacing));
@@ -65,6 +71,7 @@ namespace OpenRA.Traits
}
public string Palette(Player p) { return Info.Palette ?? Info.PlayerPalette + p.Index; }
public virtual IEnumerable<Renderable> Render(Actor self)
{
foreach (var a in anims.Values)

View File

@@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA.Effects
public Animation flag = new Animation("rallypoint");
public Animation circles = new Animation("rallypoint");
readonly string palette;
public RallyPoint(Actor building)
{
this.building = building;