using System; using System.Collections.Generic; using System.Linq; using System.Text; using OpenRa.Game.Graphics; namespace OpenRa.Game.Traits { class WithShadow : IRenderModifier { public WithShadow(Actor self) {} public IEnumerable> ModifyRender(Actor self, IEnumerable> r) { var unit = self.traits.Get(); var shadowSprites = r.Select( a => Tuple.New( a.a, a.b, 8 )); var flyingSprites = r.Select( a => Tuple.New( a.a, a.b - new float2( 0, unit.Altitude ), a.c )); return shadowSprites.Concat(flyingSprites); } } }