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:
@@ -62,12 +62,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { }
|
||||
public class SpawnedByMapInit : IActorInit<string>, ISuppressInitExport
|
||||
public class SkipMakeAnimsInit : RuntimeFlagInit { }
|
||||
public class SpawnedByMapInit : ValueActorInit<string>, ISuppressInitExport
|
||||
{
|
||||
public readonly string Name;
|
||||
public SpawnedByMapInit(string name) { Name = name; }
|
||||
|
||||
public string Value { get { return Name; } }
|
||||
public SpawnedByMapInit(string value)
|
||||
: base(value) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user