Replace ITraitInfo interface with TraitInfo class.
This commit is contained in:
@@ -13,14 +13,14 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits.Sound
|
||||
{
|
||||
class ActorLostNotificationInfo : ITraitInfo
|
||||
class ActorLostNotificationInfo : TraitInfo
|
||||
{
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string Notification = "UnitLost";
|
||||
|
||||
public readonly bool NotifyAll = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ActorLostNotification(this); }
|
||||
public override object Create(ActorInitializer init) { return new ActorLostNotification(this); }
|
||||
}
|
||||
|
||||
class ActorLostNotification : INotifyKilled
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits.Sound
|
||||
{
|
||||
[Desc("Play the Kill voice of this actor when eliminating enemies.")]
|
||||
public class AnnounceOnKillInfo : ITraitInfo
|
||||
public class AnnounceOnKillInfo : TraitInfo
|
||||
{
|
||||
[Desc("Minimum duration (in seconds) between sound events.")]
|
||||
public readonly int Interval = 5;
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
[Desc("Voice to use when killing something.")]
|
||||
public readonly string Voice = "Kill";
|
||||
|
||||
public object Create(ActorInitializer init) { return new AnnounceOnKill(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AnnounceOnKill(init.Self, this); }
|
||||
}
|
||||
|
||||
public class AnnounceOnKill : INotifyAppliedDamage
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
{
|
||||
[Desc("Players will be notified when this actor becomes visible to them.",
|
||||
"Requires the 'EnemyWatcher' trait on the player actor.")]
|
||||
public class AnnounceOnSeenInfo : ITraitInfo
|
||||
public class AnnounceOnSeenInfo : TraitInfo
|
||||
{
|
||||
[Desc("Should there be a radar ping on enemies' radar at the actor's location when they see him")]
|
||||
public readonly bool PingRadar = false;
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
|
||||
public readonly bool AnnounceNeutrals = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new AnnounceOnSeen(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AnnounceOnSeen(init.Self, this); }
|
||||
}
|
||||
|
||||
public class AnnounceOnSeen : INotifyDiscovered
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits.Sound
|
||||
{
|
||||
public class CaptureNotificationInfo : ITraitInfo
|
||||
public class CaptureNotificationInfo : TraitInfo
|
||||
{
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The speech notification to play to the new owner.")]
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
[Desc("Specifies if LoseNotification is played with the voice of the new owners faction.")]
|
||||
public readonly bool LoseNewOwnerVoice = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new CaptureNotification(this); }
|
||||
public override object Create(ActorInitializer init) { return new CaptureNotification(this); }
|
||||
}
|
||||
|
||||
public class CaptureNotification : INotifyCapture
|
||||
|
||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits.Sound
|
||||
{
|
||||
public class SoundOnDamageTransitionInfo : ITraitInfo
|
||||
public class SoundOnDamageTransitionInfo : TraitInfo
|
||||
{
|
||||
[Desc("Play a random sound from this list when damaged.")]
|
||||
public readonly string[] DamagedSounds = { };
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
[Desc("Play a random sound from this list when destroyed.")]
|
||||
public readonly string[] DestroyedSounds = { };
|
||||
|
||||
public object Create(ActorInitializer init) { return new SoundOnDamageTransition(this); }
|
||||
public override object Create(ActorInitializer init) { return new SoundOnDamageTransition(this); }
|
||||
}
|
||||
|
||||
public class SoundOnDamageTransition : INotifyDamageStateChanged
|
||||
|
||||
Reference in New Issue
Block a user