Replace IActorInit with an abstract class.
A shared ValueActorInit<T> is introduced to reduce duplication in the most common init cases, and an ActorInitActorReference allow actors to be referenced by map.yaml name.
This commit is contained in:
@@ -120,12 +120,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class PlugsInit : IActorInit<Dictionary<CVec, string>>
|
||||
public class PlugsInit : ValueActorInit<Dictionary<CVec, string>>
|
||||
{
|
||||
[DictionaryFromYamlKey]
|
||||
readonly Dictionary<CVec, string> value = new Dictionary<CVec, string>();
|
||||
public PlugsInit() { }
|
||||
public PlugsInit(Dictionary<CVec, string> init) { value = init; }
|
||||
public Dictionary<CVec, string> Value { get { return value; } }
|
||||
public PlugsInit(Dictionary<CVec, string> value)
|
||||
: base(value) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user