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:
@@ -171,13 +171,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Player IEffectiveOwner.Owner { get { return effectiveOwner; } }
|
||||
}
|
||||
|
||||
public class HuskSpeedInit : IActorInit<int>
|
||||
public class HuskSpeedInit : ValueActorInit<int>
|
||||
{
|
||||
[FieldFromYamlKey]
|
||||
readonly int value = 0;
|
||||
|
||||
public HuskSpeedInit() { }
|
||||
public HuskSpeedInit(int init) { value = init; }
|
||||
public int Value { get { return value; } }
|
||||
public HuskSpeedInit(int value)
|
||||
: base(value) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user