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