From 6c3ff0dc02c1431c348bc58f7c1ce1a0b992eca0 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 14 Jul 2017 04:51:58 +0200 Subject: [PATCH] Make AircraftInfo more readable Added some descriptions where I considered it necessary, added newlines between entries, reordered entries where it made sense. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 8cb441bdb0..b2725b99a6 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -26,31 +26,36 @@ namespace OpenRA.Mods.Common.Traits UsesInit, UsesInit, IActorPreviewInitInfo { public readonly WDist CruiseAltitude = new WDist(1280); - public readonly WDist IdealSeparation = new WDist(1706); + [Desc("Whether the aircraft can be repulsed.")] public readonly bool Repulsable = true; + + [Desc("The distance it tries to maintain from other aircraft if repulsable.")] + public readonly WDist IdealSeparation = new WDist(1706); + [Desc("The speed at which the aircraft is repulsed from other aircraft. Specify -1 for normal movement speed.")] public readonly int RepulsionSpeed = -1; [ActorReference] public readonly HashSet RepairBuildings = new HashSet { }; + [ActorReference] public readonly HashSet RearmBuildings = new HashSet { }; + public readonly int InitialFacing = 0; + public readonly int TurnSpeed = 255; + public readonly int Speed = 1; [Desc("Minimum altitude where this aircraft is considered airborne.")] public readonly int MinAirborneAltitude = 1; + public readonly HashSet LandableTerrainTypes = new HashSet(); [Desc("Can the actor be ordered to move in to shroud?")] public readonly bool MoveIntoShroud = true; - public virtual object Create(ActorInitializer init) { return new Aircraft(init, this); } - public int GetInitialFacing() { return InitialFacing; } - public WDist GetCruiseAltitude() { return CruiseAltitude; } - [VoiceReference] public readonly string Voice = "Action"; [GrantedConditionReference] @@ -73,6 +78,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Does this actor cancel its previous activity after resupplying?")] public readonly bool AbortOnResupply = true; + [Desc("Altitude at which the aircraft considers itself landed.")] public readonly WDist LandAltitude = WDist.Zero; [Desc("How fast this actor ascends or descends when using horizontal take off/landing.")] @@ -96,6 +102,11 @@ namespace OpenRA.Mods.Common.Traits [Desc("Facing to use for actor previews (map editor, color picker, etc)")] public readonly int PreviewFacing = 92; + public int GetInitialFacing() { return InitialFacing; } + public WDist GetCruiseAltitude() { return CruiseAltitude; } + + public virtual object Create(ActorInitializer init) { return new Aircraft(init, this); } + IEnumerable IActorPreviewInitInfo.ActorPreviewInits(ActorInfo ai, ActorPreviewType type) { yield return new FacingInit(PreviewFacing); @@ -106,6 +117,7 @@ namespace OpenRA.Mods.Common.Traits public readonly BooleanExpression LandOnCondition; public IReadOnlyDictionary OccupiedCells(ActorInfo info, CPos location, SubCell subCell = SubCell.Any) { return new ReadOnlyDictionary(); } + bool IOccupySpaceInfo.SharesCell { get { return false; } } // Used to determine if an aircraft can spawn landed