remove 'private' keyword where possible

This commit is contained in:
Chris Forbes
2011-06-29 09:15:39 +12:00
parent 587b2ef0d1
commit 0e45968573
16 changed files with 27 additions and 34 deletions

View File

@@ -19,9 +19,10 @@ namespace OpenRA.Editor
InitializeComponent();
}
private void SelectText(object sender, System.EventArgs e)
void SelectText(object sender, System.EventArgs e)
{
(sender as NumericUpDown).Select(0, (sender as NumericUpDown).ToString().Length);
var ud = sender as NumericUpDown;
ud.Select(0, ud.ToString().Length);
}
}
}

View File

@@ -158,7 +158,7 @@ namespace OpenRA.FileFormats
}
// Decode a code using huffman table h.
private static int Decode(Huffman h, BitReader br)
static int Decode(Huffman h, BitReader br)
{
int code = 0; // len bits being decoded
int first = 0; // first code of length len

View File

@@ -63,7 +63,7 @@ namespace OpenRA.FileFormats
public Size Size { get { return new Size(Width, Height); } }
private readonly List<ImageHeader> headers = new List<ImageHeader>();
readonly List<ImageHeader> headers = new List<ImageHeader>();
int recurseDepth = 0;
@@ -156,7 +156,7 @@ namespace OpenRA.FileFormats
return compressedBytes;
}
private byte[] CopyImageData( byte[] baseImage )
byte[] CopyImageData( byte[] baseImage )
{
byte[] imageData = new byte[ Width * Height ];
for( int i = 0 ; i < Width * Height ; i++ )

View File

@@ -48,7 +48,7 @@ namespace OpenRA
[Sync]
public Player Owner;
private Activity currentActivity;
Activity currentActivity;
public Group Group;
internal Actor(World world, string name, TypeDictionary initDict )

View File

@@ -32,7 +32,7 @@ namespace OpenRA
public static int CellSize { get { return modData.Manifest.TileSize; } }
public static ModData modData;
private static WorldRenderer worldRenderer;
static WorldRenderer worldRenderer;
public static Viewport viewport;
public static Settings Settings;

View File

@@ -22,7 +22,7 @@ namespace OpenRA
{
public readonly Manifest Manifest;
public readonly ObjectCreator ObjectCreator;
public Dictionary<string, Map> AvailableMaps {get; private set;}
public Dictionary<string, Map> AvailableMaps { get; private set; }
public readonly WidgetLoader WidgetLoader;
public ILoadScreen LoadScreen = null;
public SheetBuilder SheetBuilder;

View File

@@ -26,7 +26,7 @@ namespace OpenRA
public int Deaths;
public WinState WinState = WinState.Undefined;
public readonly ColorRamp ColorRamp;
public readonly ColorRamp ColorRamp;
public readonly string PlayerName;
public readonly string InternalName;

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Widgets
public class ScrollingTextWidget : Widget
{
public string Text = "";
private string ScrollingText = "";
string ScrollingText = "";
public string Background = null;
@@ -27,10 +27,10 @@ namespace OpenRA.Widgets
// ticks per single letter scroll
public int ScrollRate = 4;
private string ScrollBuffer = "";
string ScrollBuffer = "";
private int ScrollLocation = 0;
private int ScrollTick = 0;
int ScrollLocation = 0;
int ScrollTick = 0;
public Func<string> GetText;
public Func<string> GetBackground;
@@ -67,22 +67,18 @@ namespace OpenRA.Widgets
ScrollTick = 0;
}
private void UpdateScrollBuffer()
void UpdateScrollBuffer()
{
ScrollTick++;
if (ScrollTick < ScrollRate)
{
return;
}
ScrollTick = 0;
ScrollBuffer = "";
if (ScrollingText.Substring(ScrollingText.Length - 4, 3) != " ")
{
ScrollingText += " ";
}
int tempScrollLocation = ScrollLocation;
for (int i = 0; i < ScrollLength; ++i)

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Widgets
// This is bogus
public float2 Range = new float2(0f, 1f);
private float Offset = 0;
float Offset = 0;
int2 lastMouseLocation;
protected bool isMoving = false;

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Widgets
get { return rootWidget; }
set { rootWidget = value; }
}
private static Widget rootWidget = new ContainerWidget();
static Widget rootWidget = new ContainerWidget();
public Widget(Widget widget)
{
@@ -401,4 +401,4 @@ namespace OpenRA.Widgets
{
void Init();
}
}
}

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Air
{
public readonly int2 Pos;
private Fly( int2 px ) { Pos = px; }
Fly( int2 px ) { Pos = px; }
public static Fly ToPx( int2 px ) { return new Fly( px ); }
public static Fly ToCell( int2 pos ) { return new Fly( Util.CenterOfCell( pos ) ); }

View File

@@ -29,9 +29,8 @@ namespace OpenRA.Mods.RA
class Contrail : ITick, IPostRender
{
private ContrailInfo Info = null;
private Turret ContrailTurret = null;
ContrailInfo Info = null;
Turret ContrailTurret = null;
ContrailHistory history;

View File

@@ -439,7 +439,7 @@ namespace OpenRA.Mods.RA
}
//Build a random unit of the given type. Not going to be needed once there is actual AI...
private void BuildRandom(string category)
void BuildRandom(string category)
{
// Pick a free queue
var queue = world.ActorsWithTrait<ProductionQueue>()

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
class DefaultShellmapScript: IWorldLoaded, ITick
{
Dictionary<string, Actor> Actors;
private static int2 ViewportOrigin;
static int2 ViewportOrigin;
public void WorldLoaded(World w)
{

View File

@@ -13,14 +13,11 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class SurrenderOnDisconnectInfo : TraitInfo<SurrenderOnDisconnect>
{
}
class SurrenderOnDisconnectInfo : TraitInfo<SurrenderOnDisconnect> {}
class SurrenderOnDisconnect : ITick
{
private bool Disconnected = false;
bool Disconnected = false;
public void Tick(Actor self)
{

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Mods.RA
}
}
private void ChangeOwnership(Actor self, Player previousOwner, Player originalOwner)
void ChangeOwnership(Actor self, Player previousOwner, Player originalOwner)
{
self.World.AddFrameEndTask(w =>
{
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.RA
});
}
private void ChangeOwnership(Actor self, Actor captor, Player previousOwner)
void ChangeOwnership(Actor self, Actor captor, Player previousOwner)
{
self.World.AddFrameEndTask(w =>
{