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:
@@ -168,13 +168,9 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
public class RuntimeNeighbourInit : IActorInit<Dictionary<CPos, string[]>>, ISuppressInitExport
|
||||
public class RuntimeNeighbourInit : ValueActorInit<Dictionary<CPos, string[]>>, ISuppressInitExport
|
||||
{
|
||||
[FieldFromYamlKey]
|
||||
readonly Dictionary<CPos, string[]> value = null;
|
||||
|
||||
public RuntimeNeighbourInit() { }
|
||||
public RuntimeNeighbourInit(Dictionary<CPos, string[]> init) { value = init; }
|
||||
public Dictionary<CPos, string[]> Value { get { return value; } }
|
||||
public RuntimeNeighbourInit(Dictionary<CPos, string[]> value)
|
||||
: base(value) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user