Cleaner access to InitialFacing and ROT
This commit is contained in:
@@ -26,7 +26,7 @@ namespace OpenRA.Traits.Activities
|
||||
public IActivity Tick( Actor self )
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
var ROT = self.traits.WithInterface<IMove>().FirstOrDefault().ROT(self);
|
||||
var ROT = self.traits.Get<IMove>().ROT;
|
||||
|
||||
if( desiredFacing == unit.Facing )
|
||||
return NextActivity;
|
||||
|
||||
@@ -91,9 +91,8 @@ namespace OpenRA.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public int ROT(Actor self){ return Info.ROT; }
|
||||
|
||||
public int InitialFacing(Actor self){ return Info.InitialFacing; }
|
||||
public int ROT { get { return Info.ROT; } }
|
||||
public int InitialFacing { get { return Info.InitialFacing; } }
|
||||
|
||||
public void SetPosition(Actor self, int2 cell)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public virtual int CreationFacing( Actor self, Actor newUnit )
|
||||
{
|
||||
return newUnit.traits.Get<IMove>().InitialFacing(newUnit);
|
||||
return newUnit.traits.Get<IMove>().InitialFacing;
|
||||
}
|
||||
|
||||
public virtual bool Produce( Actor self, ActorInfo producee )
|
||||
|
||||
@@ -110,8 +110,8 @@ namespace OpenRA.Traits
|
||||
float MovementCostForCell(Actor self, int2 cell);
|
||||
float MovementSpeedForCell(Actor self, int2 cell);
|
||||
IEnumerable<float2> GetCurrentPath(Actor self);
|
||||
int ROT(Actor self);
|
||||
int InitialFacing(Actor self);
|
||||
int ROT { get; }
|
||||
int InitialFacing { get; }
|
||||
}
|
||||
|
||||
public interface IOffsetCenterLocation { float2 CenterOffset { get; } }
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace OpenRA.Mods.RA
|
||||
get { return Location; }
|
||||
}
|
||||
|
||||
public int ROT(Actor self){ return Info.ROT; }
|
||||
public int ROT { get { return Info.ROT; } }
|
||||
|
||||
public int InitialFacing(Actor self){ return Info.InitialFacing; }
|
||||
public int InitialFacing { get { return Info.InitialFacing; } }
|
||||
|
||||
public void SetPosition(Actor self, int2 cell)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user