Enforce use of 'var' instead of explicit type.
This commit is contained in:
committed by
Matthias Mailänder
parent
982c97dc6c
commit
19ecddcd86
@@ -760,10 +760,10 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
|
||||
WVec HomingTick(World world, in WVec tarDistVec, int relTarHorDist)
|
||||
{
|
||||
int predClfHgt = 0;
|
||||
int predClfDist = 0;
|
||||
int lastHtChg = 0;
|
||||
int lastHt = 0;
|
||||
var predClfHgt = 0;
|
||||
var predClfDist = 0;
|
||||
var lastHtChg = 0;
|
||||
var lastHt = 0;
|
||||
|
||||
if (info.TerrainHeightAware)
|
||||
InclineLookahead(world, relTarHorDist, out predClfHgt, out predClfDist, out lastHtChg, out lastHt);
|
||||
|
||||
@@ -175,8 +175,8 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
return false;
|
||||
}
|
||||
|
||||
AsyncLoader l = new AsyncLoader(Media.LoadVideo);
|
||||
IAsyncResult ar = l.BeginInvoke(s, null, null);
|
||||
var l = new AsyncLoader(Media.LoadVideo);
|
||||
var ar = l.BeginInvoke(s, null, null);
|
||||
Action onLoadComplete = () =>
|
||||
{
|
||||
Media.StopFMVInRadar();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common
|
||||
/// /// </summary>
|
||||
public static Target RecalculateInvalidatingHiddenTargets(this Target t, Player viewer)
|
||||
{
|
||||
var updated = t.Recalculate(viewer, out bool targetIsHiddenActor);
|
||||
var updated = t.Recalculate(viewer, out var targetIsHiddenActor);
|
||||
return targetIsHiddenActor ? Target.Invalid : updated;
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var chosenTarget = Target.Invalid;
|
||||
var chosenTargetPriority = int.MinValue;
|
||||
int chosenTargetRange = 0;
|
||||
var chosenTargetRange = 0;
|
||||
|
||||
var activePriorities = activeTargetPriorities.ToList();
|
||||
if (activePriorities.Count == 0)
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var type = BuildingType.Building;
|
||||
CPos? location = null;
|
||||
var actorVariant = 0;
|
||||
string orderString = "PlaceBuilding";
|
||||
var orderString = "PlaceBuilding";
|
||||
|
||||
// Check if Building is a plug for other Building
|
||||
var actorInfo = world.Map.Rules.Actors[currentBuilding.Item];
|
||||
|
||||
@@ -376,7 +376,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var availCells = new List<CPos>();
|
||||
var notStupidCells = new List<CPos>();
|
||||
foreach (CVec direction in CVec.Directions)
|
||||
foreach (var direction in CVec.Directions)
|
||||
{
|
||||
var p = ToCell + direction;
|
||||
if (CanEnterCell(p) && CanStayInCell(p) && (preferToAvoid == null || !preferToAvoid(p)))
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
|
||||
{
|
||||
var knownKeys = new HashSet<TKey>();
|
||||
foreach (TSource element in source)
|
||||
foreach (var element in source)
|
||||
{
|
||||
if (knownKeys.Add(keySelector(element)))
|
||||
yield return element;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
return PrintUsage();
|
||||
|
||||
var invalid = false;
|
||||
for (int i = 1; i < args.Length; i++)
|
||||
for (var i = 1; i < args.Length; i++)
|
||||
{
|
||||
var parts = args[i].Split(Comma, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length != 3 && parts.Length != 4)
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
[Desc("Convert r,g,b[,a] triples/quads into hex colors")]
|
||||
void IUtilityCommand.Run(Utility utility, string[] args)
|
||||
{
|
||||
for (int i = 1; i < args.Length;)
|
||||
for (var i = 1; i < args.Length;)
|
||||
{
|
||||
var parts = args[i].Split(Comma, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length == 3)
|
||||
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
return PrintUsage();
|
||||
|
||||
var invalid = false;
|
||||
for (int i = 1; i < args.Length; i++)
|
||||
for (var i = 1; i < args.Length; i++)
|
||||
{
|
||||
var parts = args[i].Split(Comma, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length != 3 && parts.Length != 4)
|
||||
@@ -180,7 +180,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
[Desc("Convert a,r,g,b legacy colors into hex colors")]
|
||||
void IUtilityCommand.Run(Utility utility, string[] args)
|
||||
{
|
||||
for (int i = 1; i < args.Length;)
|
||||
for (var i = 1; i < args.Length;)
|
||||
{
|
||||
var parts = args[i].Split(Comma, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length == 3)
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
var animations = new ModelAnimation[] { animation };
|
||||
|
||||
ModelPreview preview = new ModelPreview(
|
||||
var preview = new ModelPreview(
|
||||
new ModelAnimation[] { animation }, WVec.Zero, 0,
|
||||
cachedScale,
|
||||
new WAngle(cachedLightPitch),
|
||||
|
||||
Reference in New Issue
Block a user