Don’t export certain Init types.

This commit is contained in:
Paul Chote
2015-04-20 02:52:03 +12:00
parent b5ff247fa5
commit 8a171bb452
5 changed files with 9 additions and 4 deletions

View File

@@ -15,6 +15,8 @@ using OpenRA.Primitives;
namespace OpenRA namespace OpenRA
{ {
public interface ISuppressInitExport { }
public class ActorReference : IEnumerable public class ActorReference : IEnumerable
{ {
public string Type; public string Type;
@@ -51,6 +53,9 @@ namespace OpenRA
var ret = new MiniYaml(Type); var ret = new MiniYaml(Type);
foreach (var init in InitDict) foreach (var init in InitDict)
{ {
if (init is ISuppressInitExport)
continue;
var initName = init.GetType().Name; var initName = init.GetType().Name;
ret.Nodes.Add(new MiniYamlNode(initName.Substring(0, initName.Length - 4), FieldSaver.Save(init))); ret.Nodes.Add(new MiniYamlNode(initName.Substring(0, initName.Length - 4), FieldSaver.Save(init)));
} }

View File

@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits
} }
} }
public class HideBibPreviewInit : IActorInit<bool> public class HideBibPreviewInit : IActorInit<bool>, ISuppressInitExport
{ {
[FieldFromYamlKey] readonly bool value = true; [FieldFromYamlKey] readonly bool value = true;
public HideBibPreviewInit() { } public HideBibPreviewInit() { }

View File

@@ -349,7 +349,7 @@ namespace OpenRA.Mods.Common.Traits
public interface INotifyPassengerEntered { void PassengerEntered(Actor self, Actor passenger); } public interface INotifyPassengerEntered { void PassengerEntered(Actor self, Actor passenger); }
public interface INotifyPassengerExited { void PassengerExited(Actor self, Actor passenger); } public interface INotifyPassengerExited { void PassengerExited(Actor self, Actor passenger); }
public class RuntimeCargoInit : IActorInit<Actor[]> public class RuntimeCargoInit : IActorInit<Actor[]>, ISuppressInitExport
{ {
[FieldFromYamlKey] [FieldFromYamlKey]
readonly Actor[] value = { }; readonly Actor[] value = { };

View File

@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits
} }
} }
public class RuntimeNeighbourInit : IActorInit<Dictionary<CPos, string[]>> public class RuntimeNeighbourInit : IActorInit<Dictionary<CPos, string[]>>, ISuppressInitExport
{ {
[FieldFromYamlKey] readonly Dictionary<CPos, string[]> value = null; [FieldFromYamlKey] readonly Dictionary<CPos, string[]> value = null;
public RuntimeNeighbourInit() { } public RuntimeNeighbourInit() { }

View File

@@ -41,5 +41,5 @@ namespace OpenRA.Mods.Common.Traits
} }
} }
public class SkipMakeAnimsInit : IActorInit { } public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { }
} }