Changed code to use object initializers everywhere
This commit is contained in:
@@ -66,8 +66,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
facing = () => f;
|
||||
}
|
||||
|
||||
var anim = new Animation(init.World, Image ?? image, facing);
|
||||
anim.IsDecoration = IsDecoration;
|
||||
var anim = new Animation(init.World, Image ?? image, facing)
|
||||
{
|
||||
IsDecoration = IsDecoration
|
||||
};
|
||||
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequence));
|
||||
|
||||
var body = init.Actor.TraitInfo<BodyOrientationInfo>();
|
||||
@@ -94,8 +97,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
var body = self.Trait<BodyOrientation>();
|
||||
|
||||
var image = info.Image ?? rs.GetImage(self);
|
||||
overlay = new Animation(self.World, image, () => IsTraitPaused);
|
||||
overlay.IsDecoration = info.IsDecoration;
|
||||
overlay = new Animation(self.World, image, () => IsTraitPaused)
|
||||
{
|
||||
IsDecoration = info.IsDecoration
|
||||
};
|
||||
|
||||
if (info.StartSequence != null)
|
||||
overlay.PlayThen(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.StartSequence),
|
||||
() => overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence)));
|
||||
|
||||
Reference in New Issue
Block a user