From eab93ccf973f579741f45c720a9206240adb0c84 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 8 Aug 2017 14:31:23 +0200 Subject: [PATCH] Add an EffectiveOwnerInit --- OpenRA.Mods.Common/ActorInitializer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenRA.Mods.Common/ActorInitializer.cs b/OpenRA.Mods.Common/ActorInitializer.cs index fc2eb8cf0f..6b696a3957 100644 --- a/OpenRA.Mods.Common/ActorInitializer.cs +++ b/OpenRA.Mods.Common/ActorInitializer.cs @@ -44,4 +44,13 @@ namespace OpenRA.Mods.Common public FactionInit(string faction) { Faction = faction; } public string Value(World world) { return Faction; } } + + public class EffectiveOwnerInit : IActorInit + { + [FieldFromYamlKey] readonly Player value = null; + + public EffectiveOwnerInit() { } + public EffectiveOwnerInit(Player owner) { value = owner; } + Player IActorInit.Value(World world) { return value; } + } }