Fix variable ordering.

This commit is contained in:
Paul Chote
2014-12-26 11:05:22 +13:00
parent 22ab35f681
commit 362b4aeaef
6 changed files with 18 additions and 22 deletions

View File

@@ -19,6 +19,8 @@ namespace OpenRA.Mods.Common.Graphics
public int Length { get { return trail.Length; } }
readonly World world;
readonly Color color;
readonly int zOffset;
// Store trail positions in a circular buffer
readonly WPos[] trail;
@@ -26,9 +28,6 @@ namespace OpenRA.Mods.Common.Graphics
int length;
int skip;
readonly Color color;
readonly int zOffset;
public ContrailRenderable(World world, Color color, int length, int skip, int zOffset)
: this(world, new WPos[length], 0, 0, skip, color, zOffset) { }

View File

@@ -25,19 +25,19 @@ namespace OpenRA.Mods.Common.Traits
class LightPaletteRotator : ITick, IPaletteModifier
{
float t = 0;
public void Tick(Actor self)
{
t += .5f;
}
readonly LightPaletteRotatorInfo info;
float t = 0;
public LightPaletteRotator(LightPaletteRotatorInfo info)
{
this.info = info;
}
public void Tick(Actor self)
{
t += .5f;
}
public void AdjustPalette(IReadOnlyDictionary<string, MutablePalette> palettes)
{
foreach (var pal in palettes)

View File

@@ -25,10 +25,9 @@ namespace OpenRA.Mods.Common.Traits
class WaterPaletteRotation : ITick, IPaletteModifier
{
float t = 0;
readonly WaterPaletteRotationInfo info;
readonly World world;
float t = 0;
public WaterPaletteRotation(World world, WaterPaletteRotationInfo info)
{

View File

@@ -88,6 +88,8 @@ namespace OpenRA.Mods.Common.Traits
}
}
readonly RenderSpritesInfo info;
string cachedImage = null;
Dictionary<string, AnimationWrapper> anims = new Dictionary<string, AnimationWrapper>();
public static Func<int> MakeFacingFunc(Actor self)
@@ -97,9 +99,6 @@ namespace OpenRA.Mods.Common.Traits
return () => facing.Facing;
}
readonly RenderSpritesInfo info;
string cachedImage = null;
public RenderSprites(Actor self)
{
info = self.Info.Traits.Get<RenderSpritesInfo>();

View File

@@ -22,12 +22,12 @@ namespace OpenRA.Mods.Common
[Desc("Range between falloff steps.")]
public readonly WRange Spread = new WRange(43);
[Desc("Ranges at which each Falloff step is defined. Overrides Spread.")]
public WRange[] Range = null;
[Desc("Damage percentage at each range step")]
public readonly int[] Falloff = { 100, 37, 14, 5, 2, 1, 0 };
[Desc("Ranges at which each Falloff step is defined. Overrides Spread.")]
public WRange[] Range = null;
public void InitializeRange()
{
if (Range != null)

View File

@@ -29,6 +29,10 @@ namespace OpenRA.Mods.Common.Widgets
public Action AfterClose = () => { };
public Action<float> Animating = _ => { };
readonly World world;
readonly WorldRenderer worldRenderer;
readonly RadarPings radarPings;
float radarMinimapHeight;
int frame;
bool hasRadar;
@@ -46,11 +50,6 @@ namespace OpenRA.Mods.Common.Widgets
Sprite shroudSprite;
Shroud renderShroud;
readonly World world;
readonly WorldRenderer worldRenderer;
readonly RadarPings radarPings;
[ObjectCreator.UseCtor]
public RadarWidget(World world, WorldRenderer worldRenderer)
{