Actor.traits is implementation detail
This commit is contained in:
@@ -56,7 +56,7 @@ namespace OpenRA.Orders
|
||||
|
||||
public void Tick( World world )
|
||||
{
|
||||
var producing = Producer.traits.Get<Traits.ProductionQueue>().CurrentItem( Rules.Info[ Building ].Category );
|
||||
var producing = Producer.Trait<Traits.ProductionQueue>().CurrentItem( Rules.Info[ Building ].Category );
|
||||
if (producing == null || producing.Item != Building || producing.RemainingTime != 0)
|
||||
world.CancelInputMode();
|
||||
}
|
||||
|
||||
@@ -38,21 +38,21 @@ namespace OpenRA.Orders
|
||||
public void RenderBeforeWorld(World world)
|
||||
{
|
||||
foreach (var a in world.Selection.Actors)
|
||||
foreach (var t in a.traits.WithInterface<IPreRenderSelection>())
|
||||
foreach (var t in a.TraitsImplementing<IPreRenderSelection>())
|
||||
t.RenderBeforeWorld(a);
|
||||
}
|
||||
|
||||
public void RenderAfterWorld( World world )
|
||||
{
|
||||
foreach (var a in world.Selection.Actors)
|
||||
foreach (var t in a.traits.WithInterface<IPostRenderSelection>())
|
||||
foreach (var t in a.TraitsImplementing<IPostRenderSelection>())
|
||||
t.RenderAfterWorld(a);
|
||||
}
|
||||
|
||||
public string GetCursor( World world, int2 xy, MouseInput mi )
|
||||
{
|
||||
var c = Order(world, xy, mi)
|
||||
.Select(o => o.Subject.traits.WithInterface<IOrderCursor>()
|
||||
.Select(o => o.Subject.TraitsImplementing<IOrderCursor>()
|
||||
.Select(pc => pc.CursorForOrder(o.Subject, o)).FirstOrDefault(a => a != null))
|
||||
.FirstOrDefault(a => a != null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user