Fix StyleCop warnings in OpenRA.Mods.RA

This commit is contained in:
Hellhake
2015-01-01 23:03:55 +01:00
parent e9989496c4
commit b6410bc1e0
134 changed files with 261 additions and 267 deletions

View File

@@ -12,8 +12,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using AI.Fuzzy.Library;
using OpenRA.Mods.RA.Traits;
using OpenRA.GameRules;
using OpenRA.Mods.RA.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.AI
@@ -201,6 +201,7 @@ namespace OpenRA.Mods.RA.AI
if (warhead != null)
sumOfDamage += warhead.Damage;
}
return sumOfDamage;
});
}

View File

@@ -73,10 +73,9 @@ namespace OpenRA.Mods.RA.AI
HackyAI.BotDebug("AI: {0} is starting production of {1}".F(player, item.Name));
world.IssueOrder(Order.StartProduction(queue.Actor, item.Name, 1));
}
// Production is complete
else if (currentBuilding.Done)
{
// Production is complete
// Choose the placement logic
// HACK: HACK HACK HACK
var type = BuildingType.Building;

View File

@@ -735,6 +735,7 @@ namespace OpenRA.Mods.RA.AI
foreach (var kv in powers)
{
var sp = kv.Value;
// Add power to dictionary if not in delay dictionary yet
if (!waitingPowers.ContainsKey(sp))
waitingPowers.Add(sp, 0);
@@ -743,7 +744,7 @@ namespace OpenRA.Mods.RA.AI
waitingPowers[sp]--;
// If we have recently tried and failed to find a use location for a power, then do not try again until later
var isDelayed = (waitingPowers[sp] > 0);
var isDelayed = waitingPowers[sp] > 0;
if (sp.Ready && !isDelayed && powerDecisions.ContainsKey(sp.Info.OrderName))
{
var powerDecision = powerDecisions[sp.Info.OrderName];
@@ -780,7 +781,7 @@ namespace OpenRA.Mods.RA.AI
}
}
///<summary>Scans the map in chunks, evaluating all actors in each.</summary>
/// <summary>Scans the map in chunks, evaluating all actors in each.</summary>
CPos? FindCoarseAttackLocationToSupportPower(SupportPowerInstance readyPower)
{
CPos? bestLocation = null;
@@ -815,7 +816,7 @@ namespace OpenRA.Mods.RA.AI
return bestLocation;
}
///<summary>Detail scans an area, evaluating positions.</summary>
/// <summary>Detail scans an area, evaluating positions.</summary>
CPos? FindFineAttackLocationToSupportPower(SupportPowerInstance readyPower, CPos checkPos, int extendedRange = 1)
{
CPos? bestLocation = null;
@@ -829,11 +830,11 @@ namespace OpenRA.Mods.RA.AI
var checkRadius = powerDecision.CoarseScanRadius;
var fineCheck = powerDecision.FineScanRadius;
for (var i = (0 - extendedRange); i <= (checkRadius + extendedRange); i += fineCheck)
for (var i = 0 - extendedRange; i <= (checkRadius + extendedRange); i += fineCheck)
{
var x = checkPos.X + i;
for (var j = (0 - extendedRange); j <= (checkRadius + extendedRange); j += fineCheck)
for (var j = 0 - extendedRange; j <= (checkRadius + extendedRange); j += fineCheck)
{
var y = checkPos.Y + j;
var pos = world.Map.CenterOfCell(new CPos(x, y));

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA
[Desc("What support power does this decision apply to?")]
public readonly string OrderName = "AirstrikePowerInfoOrder";
[Desc("What is the coarse scan radius of this power?","For finding the general target area, before doing a detail scan","Should be 10 or more to avoid lag")]
[Desc("What is the coarse scan radius of this power?", "For finding the general target area, before doing a detail scan", "Should be 10 or more to avoid lag")]
public readonly int CoarseScanRadius = 20;
[Desc("What is the fine scan radius of this power?", "For doing a detailed scan in the general target area.", "Minimum is 1")]
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA
return ret;
}
///<summary>Evaluates the attractiveness of a position according to all considerations</summary>
/// <summary>Evaluates the attractiveness of a position according to all considerations</summary>
public int GetAttractiveness(WPos pos, Player firedBy)
{
var answer = 0;
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.RA
return answer;
}
///<summary>Evaluates the attractiveness of a group of actors according to all considerations</summary>
/// <summary>Evaluates the attractiveness of a group of actors according to all considerations</summary>
public int GetAttractiveness(IEnumerable<Actor> actors, Player firedBy)
{
var answer = 0;
@@ -95,10 +95,10 @@ namespace OpenRA.Mods.RA
public int GetNextScanTime(HackyAI ai) { return ai.random.Next(MinimumScanTimeInterval, MaximumScanTimeInterval); }
///<summary>Makes up part of a decision, describing how to evaluate a target.</summary>
/// <summary>Makes up part of a decision, describing how to evaluate a target.</summary>
class Consideration
{
public enum DecisionMetric { Health, Value, None };
public enum DecisionMetric { Health, Value, None }
[Desc("Against whom should this power be used?", "Allowed keywords: Ally, Neutral, Enemy")]
public readonly Stance Against = Stance.Enemy;
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.RA
FieldLoader.Load(this, yaml);
}
///<summary>Evaluates a single actor according to the rules defined in this consideration</summary>
/// <summary>Evaluates a single actor according to the rules defined in this consideration</summary>
public int GetAttractiveness(Actor a, Stance stance, Player firedBy)
{
if (stance != Against)
@@ -152,6 +152,7 @@ namespace OpenRA.Mods.RA
return Attractiveness;
}
}
return 0;
}
}