Add a IAutoSelctionSizeInfo trait interface
This commit is contained in:
@@ -95,6 +95,8 @@ namespace OpenRA.Traits
|
||||
public interface ITick { void Tick(Actor self); }
|
||||
public interface ITickRender { void TickRender(WorldRenderer wr, Actor self); }
|
||||
public interface IRender { IEnumerable<IRenderable> Render(Actor self, WorldRenderer wr); }
|
||||
|
||||
public interface IAutoSelectionSizeInfo : ITraitInfoInterface { }
|
||||
public interface IAutoSelectionSize { int2 SelectionSize(Actor self); }
|
||||
|
||||
public interface IIssueOrder
|
||||
|
||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, IAutoSelectionSizeInfo
|
||||
{
|
||||
[Desc("Voxel sequence name to use when docked to a refinery.")]
|
||||
public readonly string UnloadSequence = "unload";
|
||||
|
||||
@@ -22,7 +22,8 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
|
||||
public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>,
|
||||
IAutoSelectionSizeInfo
|
||||
{
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Special case trait for actors that need to define targetable area and screen map bounds manually.")]
|
||||
public class CustomSelectionSizeInfo : ITraitInfo
|
||||
public class CustomSelectionSizeInfo : ITraitInfo, IAutoSelectionSizeInfo
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
public readonly int[] CustomBounds = null;
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
[Desc("Automatically calculates the targetable area and screen map boundaries from the sprite size.")]
|
||||
public class AutoSelectionSizeInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
public class AutoSelectionSizeInfo : ITraitInfo, Requires<RenderSpritesInfo>, IAutoSelectionSizeInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new AutoSelectionSize(this); }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
[Desc("Also returns a default selection size that is calculated automatically from the voxel dimensions.")]
|
||||
public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
|
||||
public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, IAutoSelectionSizeInfo
|
||||
{
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user