Changed most references of trait Mobile -> IMove.
In Mobile.cs IsMoving now has a public set as opposed to the initial internal. Added IMoveInfo interface to go with *Info classes that require IMove. WithRotor now uses IMove.IsMoving instead of (self.CenterPosition.Z > 0) as part of a check.
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
var positionable = self.Trait<IPositionable>();
|
||||
var mobile = positionable as Mobile;
|
||||
var movement = self.Trait<IMove>();
|
||||
|
||||
var pos = length > 1
|
||||
? WPos.Lerp(start, end, ticks, length - 1)
|
||||
@@ -38,14 +38,14 @@ namespace OpenRA.Mods.RA.Move
|
||||
positionable.SetVisualPosition(self, pos);
|
||||
if (++ticks >= length)
|
||||
{
|
||||
if (mobile != null)
|
||||
mobile.IsMoving = false;
|
||||
if (movement != null)
|
||||
movement.IsMoving = false;
|
||||
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
if (mobile != null)
|
||||
mobile.IsMoving = true;
|
||||
if (movement != null)
|
||||
movement.IsMoving = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.RA.Move
|
||||
{
|
||||
[Desc("Unit is able to move.")]
|
||||
public class MobileInfo : ITraitInfo, IOccupySpaceInfo, IFacingInfo, UsesInit<FacingInit>, UsesInit<LocationInit>, UsesInit<SubCellInit>
|
||||
public class MobileInfo : ITraitInfo, IOccupySpaceInfo, IFacingInfo, IMoveInfo, UsesInit<FacingInit>, UsesInit<LocationInit>, UsesInit<SubCellInit>
|
||||
{
|
||||
[FieldLoader.LoadUsing("LoadSpeeds")]
|
||||
[Desc("Set Water: 0 for ground units and lower the value on rough terrain.")]
|
||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
{
|
||||
public readonly Actor self;
|
||||
public readonly MobileInfo Info;
|
||||
public bool IsMoving { get; internal set; }
|
||||
public bool IsMoving { get; set; }
|
||||
|
||||
int __facing;
|
||||
CPos __fromCell, __toCell;
|
||||
|
||||
Reference in New Issue
Block a user