Add ModData parameter to ILintMapPass.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
{
|
{
|
||||||
public class CheckActors : ILintMapPass
|
public class CheckActors : ILintMapPass
|
||||||
{
|
{
|
||||||
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
|
||||||
{
|
{
|
||||||
var actorTypes = map.ActorDefinitions.Select(a => a.Value.Value);
|
var actorTypes = map.ActorDefinitions.Select(a => a.Value.Value);
|
||||||
foreach (var actor in actorTypes)
|
foreach (var actor in actorTypes)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
{
|
{
|
||||||
public class CheckMapCordon : ILintMapPass
|
public class CheckMapCordon : ILintMapPass
|
||||||
{
|
{
|
||||||
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
|
||||||
{
|
{
|
||||||
if (map.Bounds.Left == 0 || map.Bounds.Top == 0
|
if (map.Bounds.Left == 0 || map.Bounds.Top == 0
|
||||||
|| map.Bounds.Right == map.MapSize.X || map.Bounds.Bottom == map.MapSize.Y)
|
|| map.Bounds.Right == map.MapSize.X || map.Bounds.Bottom == map.MapSize.Y)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
{
|
{
|
||||||
public class CheckMapMetadata : ILintMapPass
|
public class CheckMapMetadata : ILintMapPass
|
||||||
{
|
{
|
||||||
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
|
||||||
{
|
{
|
||||||
if (map.MapFormat != Map.SupportedMapFormat)
|
if (map.MapFormat != Map.SupportedMapFormat)
|
||||||
emitError("Map format {0} does not match the supported version {1}."
|
emitError("Map format {0} does not match the supported version {1}."
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
{
|
{
|
||||||
public class CheckPlayers : ILintMapPass
|
public class CheckPlayers : ILintMapPass
|
||||||
{
|
{
|
||||||
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
|
||||||
{
|
{
|
||||||
var players = new MapPlayers(map.PlayerDefinitions).Players;
|
var players = new MapPlayers(map.PlayerDefinitions).Players;
|
||||||
var worldOwnerFound = false;
|
var worldOwnerFound = false;
|
||||||
|
|||||||
@@ -25,12 +25,11 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
|
|
||||||
List<MiniYamlNode> sequenceDefinitions;
|
List<MiniYamlNode> sequenceDefinitions;
|
||||||
|
|
||||||
public void Run(Action<string> emitError, Action<string> emitWarning, Map map)
|
public void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map)
|
||||||
{
|
{
|
||||||
if (map.SequenceDefinitions == null)
|
if (map.SequenceDefinitions == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var modData = Game.ModData;
|
|
||||||
this.emitError = emitError;
|
this.emitError = emitError;
|
||||||
|
|
||||||
sequenceDefinitions = MiniYaml.Load(map, modData.Manifest.Sequences, map.SequenceDefinitions);
|
sequenceDefinitions = MiniYaml.Load(map, modData.Manifest.Sequences, map.SequenceDefinitions);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var customMapPass = (ILintMapPass)modData.ObjectCreator.CreateBasic(customMapPassType);
|
var customMapPass = (ILintMapPass)modData.ObjectCreator.CreateBasic(customMapPassType);
|
||||||
customMapPass.Run(EmitError, EmitWarning, testMap);
|
customMapPass.Run(EmitError, EmitWarning, modData, testMap);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ using System;
|
|||||||
namespace OpenRA.Mods.Common.Lint
|
namespace OpenRA.Mods.Common.Lint
|
||||||
{
|
{
|
||||||
public interface ILintPass { void Run(Action<string> emitError, Action<string> emitWarning, ModData modData); }
|
public interface ILintPass { void Run(Action<string> emitError, Action<string> emitWarning, ModData modData); }
|
||||||
public interface ILintMapPass { void Run(Action<string> emitError, Action<string> emitWarning, Map map); }
|
public interface ILintMapPass { void Run(Action<string> emitError, Action<string> emitWarning, ModData modData, Map map); }
|
||||||
public interface ILintRulesPass { void Run(Action<string> emitError, Action<string> emitWarning, Ruleset rules); }
|
public interface ILintRulesPass { void Run(Action<string> emitError, Action<string> emitWarning, Ruleset rules); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user