Make INotifyBuildComplete require explicit implementation
This commit is contained in:
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public void BuildingComplete(Actor self)
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
if (skippedMakeAnimation)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.QueueActivity(new FindResources(self));
|
||||
}
|
||||
|
||||
public void BuildingComplete(Actor self)
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
if (Info.SearchOnCreation)
|
||||
self.QueueActivity(new FindResources(self));
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
class WithGateSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, INotifyBuildComplete, IWallConnector, ITick
|
||||
class WithGateSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
|
||||
{
|
||||
readonly WithGateSpriteBodyInfo gateInfo;
|
||||
readonly Gate gate;
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
UpdateState(self);
|
||||
}
|
||||
|
||||
public override void BuildingComplete(Actor self)
|
||||
protected override void OnBuildComplete(Actor self)
|
||||
{
|
||||
UpdateState(self);
|
||||
UpdateNeighbours(self);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
playerResources = init.Self.Owner.PlayerActor.Trait<PlayerResources>();
|
||||
}
|
||||
|
||||
public void BuildingComplete(Actor self)
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
wsb.DefaultAnimation.PlayFetchIndex(wsb.NormalizeSequence(self, info.Sequence),
|
||||
() => playerResources.ResourceCapacity != 0
|
||||
|
||||
@@ -75,12 +75,17 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return RenderSprites.NormalizeSequence(DefaultAnimation, self.GetDamageState(), sequence);
|
||||
}
|
||||
|
||||
// TODO: Get rid of INotifyBuildComplete in favor of using the upgrade system
|
||||
public virtual void BuildingComplete(Actor self)
|
||||
protected virtual void OnBuildComplete(Actor self)
|
||||
{
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
|
||||
}
|
||||
|
||||
// TODO: Get rid of INotifyBuildComplete in favor of using the upgrade system
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
OnBuildComplete(self);
|
||||
}
|
||||
|
||||
public void PlayCustomAnimation(Actor self, string name, Action after = null)
|
||||
{
|
||||
DefaultAnimation.PlayThen(NormalizeSequence(self, name), () =>
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
public override void BuildingComplete(Actor self)
|
||||
protected override void OnBuildComplete(Actor self)
|
||||
{
|
||||
DefaultAnimation.PlayFetchIndex(NormalizeSequence(self, Info.Sequence), () => adjacent);
|
||||
UpdateNeighbours(self);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public void BuildingComplete(Actor self)
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
self.PlayVoice(info.Voice);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
void PreparingAttack(Actor self, Target target, Armament a, Barrel barrel);
|
||||
}
|
||||
|
||||
[RequireExplicitImplementation]
|
||||
public interface INotifyBuildComplete { void BuildingComplete(Actor self); }
|
||||
public interface INotifyBuildingPlaced { void BuildingPlaced(Actor self); }
|
||||
public interface INotifyRepair { void Repairing(Actor self, Actor target); }
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.D2k.Traits.Render
|
||||
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
||||
}
|
||||
|
||||
public void BuildingComplete(Actor self)
|
||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||
{
|
||||
buildComplete = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user