Refactored IQuantizeBodyOrientation implementation
Moved BodyOrientation and related interfaces from Game to Mods.Common. Introduced QuantizeFacingsFromSequence trait. With*Body render traits no longer implement IQuantizeBodyOrientation themselves.
This commit is contained in:
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.TS.Traits
|
||||
{
|
||||
public class WithVoxelUnloadBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
{
|
||||
[Desc("Voxel sequence name to use when docked to a refinery.")]
|
||||
public readonly string UnloadSequence = "unload";
|
||||
@@ -36,8 +36,6 @@ namespace OpenRA.Mods.TS.Traits
|
||||
() => new[] { body.QuantizeOrientation(orientation, facings) },
|
||||
() => false, () => 0);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelUnloadBody : IAutoSelectionSize
|
||||
|
||||
@@ -16,12 +16,10 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.TS.Traits
|
||||
{
|
||||
public class WithVoxelWalkerBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>
|
||||
public class WithVoxelWalkerBodyInfo : ITraitInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>
|
||||
{
|
||||
public readonly int TickRate = 5;
|
||||
public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); }
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelWalkerBody : IAutoSelectionSize, ITick
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.TS.Traits
|
||||
{
|
||||
public class WithVoxelWaterBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
public class WithVoxelWaterBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
{
|
||||
public readonly string WaterSequence = "water";
|
||||
public readonly string LandSequence = "idle";
|
||||
@@ -41,8 +41,6 @@ namespace OpenRA.Mods.TS.Traits
|
||||
() => new[] { body.QuantizeOrientation(orientation, facings) },
|
||||
() => false, () => 0);
|
||||
}
|
||||
|
||||
public int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string faction) { return 0; }
|
||||
}
|
||||
|
||||
public class WithVoxelWaterBody : IAutoSelectionSize
|
||||
|
||||
Reference in New Issue
Block a user