WorldRenderer, replace foreach ActorsWithTraits with ApplyToActorsWithTrait. #18798.
This commit is contained in:
@@ -427,7 +427,7 @@ namespace OpenRA
|
||||
foreach (var a in actors.Values)
|
||||
a.Tick();
|
||||
|
||||
ApplyToActorsWithTraitTimed<ITick>((Actor actor, ITick trait) => trait.Tick(actor), "Trait");
|
||||
ApplyToActorsWithTraitTimed<ITick>((actor, trait) => trait.Tick(actor), "Trait");
|
||||
|
||||
effects.DoTimed(e => e.Tick(this), "Effect");
|
||||
}
|
||||
@@ -439,7 +439,7 @@ namespace OpenRA
|
||||
// For things that want to update their render state once per tick, ignoring pause state
|
||||
public void TickRender(WorldRenderer wr)
|
||||
{
|
||||
ApplyToActorsWithTraitTimed<ITickRender>((Actor actor, ITickRender trait) => trait.TickRender(wr, actor), "Render");
|
||||
ApplyToActorsWithTraitTimed<ITickRender>((actor, trait) => trait.TickRender(wr, actor), "Render");
|
||||
ScreenMap.TickRender();
|
||||
}
|
||||
|
||||
@@ -503,6 +503,11 @@ namespace OpenRA
|
||||
TraitDict.ApplyToActorsWithTraitTimed<T>(action, text);
|
||||
}
|
||||
|
||||
public void ApplyToActorsWithTrait<T>(Action<Actor, T> action)
|
||||
{
|
||||
TraitDict.ApplyToActorsWithTrait<T>(action);
|
||||
}
|
||||
|
||||
public IEnumerable<Actor> ActorsHavingTrait<T>()
|
||||
{
|
||||
return TraitDict.ActorsHavingTrait<T>();
|
||||
|
||||
Reference in New Issue
Block a user