Make IVoiced require explicit implementation

This commit is contained in:
reaperrr
2018-04-29 04:43:46 +02:00
committed by Paul Chote
parent da29250711
commit cc4c5a5492
2 changed files with 5 additions and 4 deletions

View File

@@ -182,6 +182,7 @@ namespace OpenRA.Traits
public interface INotifyOwnerChanged { void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner); }
public interface INotifyEffectiveOwnerChanged { void OnEffectiveOwnerChanged(Actor self, Player oldEffectiveOwner, Player newEffectiveOwner); }
[RequireExplicitImplementation]
public interface IVoiced
{
string VoiceSet { get; }

View File

@@ -35,9 +35,9 @@ namespace OpenRA.Mods.Common.Traits
Info = info;
}
public string VoiceSet { get { return Info.VoiceSet; } }
string IVoiced.VoiceSet { get { return Info.VoiceSet; } }
public bool PlayVoice(Actor self, string phrase, string variant)
bool IVoiced.PlayVoice(Actor self, string phrase, string variant)
{
if (phrase == null)
return false;
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
return Game.Sound.PlayPredefined(SoundType.World, self.World.Map.Rules, null, self, type, phrase, variant, true, WPos.Zero, volume, true);
}
public bool PlayVoiceLocal(Actor self, string phrase, string variant, float volume)
bool IVoiced.PlayVoiceLocal(Actor self, string phrase, string variant, float volume)
{
if (phrase == null)
return false;
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits
return Game.Sound.PlayPredefined(SoundType.World, self.World.Map.Rules, null, self, type, phrase, variant, false, self.CenterPosition, volume, true);
}
public bool HasVoice(Actor self, string voice)
bool IVoiced.HasVoice(Actor self, string voice)
{
if (string.IsNullOrEmpty(Info.VoiceSet))
return false;