Add INotifyResourceDumped Interface

This commit is contained in:
Mustafa Alperen Seki
2018-11-17 14:16:44 +03:00
committed by abcdefg30
parent 1e99075c70
commit feeae74455
2 changed files with 11 additions and 0 deletions

View File

@@ -113,6 +113,14 @@ namespace OpenRA.Mods.Common.Traits
else
amount = playerResources.ChangeCash(amount);
foreach (var notify in self.World.ActorsWithTrait<INotifyResourceAccepted>())
{
if (notify.Actor.Owner != self.Owner)
continue;
notify.Trait.OnResourceAccepted(notify.Actor, self, amount);
}
if (info.ShowTicks)
currentDisplayValue += amount;
}

View File

@@ -141,6 +141,9 @@ namespace OpenRA.Mods.Common.Traits
public interface INotifyOtherProduction { void UnitProducedByOther(Actor self, Actor producer, Actor produced, string productionType, TypeDictionary init); }
public interface INotifyDelivery { void IncomingDelivery(Actor self); void Delivered(Actor self); }
public interface INotifyDocking { void Docked(Actor self, Actor harvester); void Undocked(Actor self, Actor harvester); }
[RequireExplicitImplementation]
public interface INotifyResourceAccepted { void OnResourceAccepted(Actor self, Actor refinery, int amount); }
public interface INotifyParachute { void OnParachute(Actor self); void OnLanded(Actor self, Actor ignore); }
[RequireExplicitImplementation]