Unhardcode voice/order interaction; reimplement for move and attack

This commit is contained in:
Paul Chote
2010-07-23 18:40:39 +12:00
parent 1186d40fda
commit 55e59e0b53
8 changed files with 57 additions and 23 deletions

View File

@@ -216,5 +216,12 @@ namespace OpenRA
{
return a.Info.Traits.Contains<SelectableInfo>() && a.Info.Traits.Get<SelectableInfo>().Voice != null;
}
public static VoiceInfo GetVoice(this Actor a)
{
if (!a.Info.Traits.Contains<SelectableInfo>()) return null;
var v = a.Info.Traits.Get<SelectableInfo>().Voice;
return (v == null) ? null : Rules.Voices[v];
}
}
}