put CheckAutotargetWiring in its own file
This commit is contained in:
35
OpenRA.Mods.RA/Lint/CheckAutotargetWiring.cs
Normal file
35
OpenRA.Mods.RA/Lint/CheckAutotargetWiring.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Mods.RA.Buildings;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.RA
|
||||||
|
{
|
||||||
|
class CheckAutotargetWiring : ILintPass
|
||||||
|
{
|
||||||
|
public void Run(Action<string> emitError)
|
||||||
|
{
|
||||||
|
foreach( var i in Rules.Info )
|
||||||
|
{
|
||||||
|
if (i.Key.StartsWith("^"))
|
||||||
|
continue;
|
||||||
|
var attackMove = i.Value.Traits.GetOrDefault<AttackMoveInfo>();
|
||||||
|
if (attackMove != null && !attackMove.JustMove &&
|
||||||
|
!i.Value.Traits.Contains<AutoTargetInfo>())
|
||||||
|
emitError( "{0} has AttackMove setup without AutoTarget, and will crash when resolving that order.".F(i.Key) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,20 +36,4 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CheckAutotargetWiring : ILintPass
|
|
||||||
{
|
|
||||||
public void Run(Action<string> emitError)
|
|
||||||
{
|
|
||||||
foreach( var i in Rules.Info )
|
|
||||||
{
|
|
||||||
if (i.Key.StartsWith("^"))
|
|
||||||
continue;
|
|
||||||
var attackMove = i.Value.Traits.GetOrDefault<AttackMoveInfo>();
|
|
||||||
if (attackMove != null && !attackMove.JustMove &&
|
|
||||||
!i.Value.Traits.Contains<AutoTargetInfo>())
|
|
||||||
emitError( "{0} has AttackMove setup without AutoTarget, and will crash when resolving that order.".F(i.Key) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
<Compile Include="Effects\GpsDot.cs" />
|
<Compile Include="Effects\GpsDot.cs" />
|
||||||
<Compile Include="GivesBounty.cs" />
|
<Compile Include="GivesBounty.cs" />
|
||||||
<Compile Include="Lint\LintBuildablePrerequisites.cs" />
|
<Compile Include="Lint\LintBuildablePrerequisites.cs" />
|
||||||
|
<Compile Include="Lint\CheckAutotargetWiring.cs" />
|
||||||
<Compile Include="ProductionBar.cs" />
|
<Compile Include="ProductionBar.cs" />
|
||||||
<Compile Include="Render\RenderEditorOnly.cs" />
|
<Compile Include="Render\RenderEditorOnly.cs" />
|
||||||
<Compile Include="SmokeTrailWhenDamaged.cs" />
|
<Compile Include="SmokeTrailWhenDamaged.cs" />
|
||||||
@@ -375,4 +376,4 @@
|
|||||||
copy "$(TargetPath)" "$(SolutionDir)mods/ra/"
|
copy "$(TargetPath)" "$(SolutionDir)mods/ra/"
|
||||||
cd "$(SolutionDir)"</PostBuildEvent>
|
cd "$(SolutionDir)"</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user