Make Armament implement interfaces explicitly
This commit is contained in:
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return new WDist(Util.ApplyPercentageModifiers(Weapon.Range.Length, rangeModifiers));
|
return new WDist(Util.ApplyPercentageModifiers(Weapon.Range.Length, rangeModifiers));
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Created(Actor self)
|
protected virtual void Created(Actor self)
|
||||||
{
|
{
|
||||||
turret = self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == Info.Turret);
|
turret = self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == Info.Turret);
|
||||||
ammoPool = self.TraitsImplementing<AmmoPool>().FirstOrDefault(la => la.Info.Name == Info.AmmoPoolName);
|
ammoPool = self.TraitsImplementing<AmmoPool>().FirstOrDefault(la => la.Info.Name == Info.AmmoPoolName);
|
||||||
@@ -147,7 +147,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
rangeModifiers = self.TraitsImplementing<IRangeModifier>().ToArray().Select(m => m.GetRangeModifier());
|
rangeModifiers = self.TraitsImplementing<IRangeModifier>().ToArray().Select(m => m.GetRangeModifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Tick(Actor self)
|
protected virtual void Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (IsTraitDisabled)
|
if (IsTraitDisabled)
|
||||||
return;
|
return;
|
||||||
@@ -168,6 +168,18 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
delayedActions.RemoveAll(a => a.First <= 0);
|
delayedActions.RemoveAll(a => a.First <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void INotifyCreated.Created(Actor self)
|
||||||
|
{
|
||||||
|
// Split into a protected method to allow subclassing
|
||||||
|
Created(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ITick.Tick(Actor self)
|
||||||
|
{
|
||||||
|
// Split into a protected method to allow subclassing
|
||||||
|
Tick(self);
|
||||||
|
}
|
||||||
|
|
||||||
protected void ScheduleDelayedAction(int t, Action a)
|
protected void ScheduleDelayedAction(int t, Action a)
|
||||||
{
|
{
|
||||||
if (t > 0)
|
if (t > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user