From 654f56c5d587a940ad642fc47acc8af0edb0e714 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 1 Jan 2015 18:08:08 +0100 Subject: [PATCH 1/2] Moves Attack, Armament, Move, Air traits and activities as well as anything required by them to Mods.Common. Extracts Exit from Production into its own trait. --- .../Traits/Buildings/ProductionAirdrop.cs | 1 + OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs | 2 +- .../Activities/Air/FallToEarth.cs | 4 +- .../Activities/Air/Fly.cs | 4 +- .../Activities/Air/FlyAttack.cs | 4 +- .../Activities/Air/FlyCircle.cs | 4 +- .../Activities/Air/FlyFollow.cs | 4 +- .../Activities/Air/FlyTimed.cs | 4 +- .../Activities/Air/HeliAttack.cs | 4 +- .../Activities/Air/HeliFly.cs | 4 +- .../Activities/Air/HeliFlyCircle.cs | 5 +- .../Activities/Air/HeliLand.cs | 4 +- .../Activities/Air/HeliReturn.cs | 5 +- .../Activities/Air/Land.cs | 4 +- .../Activities/Air/ResupplyAircraft.cs | 4 +- .../Activities/Air/ReturnToBase.cs | 4 +- .../Activities/Air/TakeOff.cs | 3 +- .../Activities/Attack.cs | 4 +- .../Activities/EnterTransport.cs | 4 +- .../Activities/Heal.cs | 4 +- .../Activities/Move}/AttackMoveActivity.cs | 4 +- .../Activities/Move}/Follow.cs | 3 +- .../Activities/Move}/Move.cs | 9 ++- .../Activities/Move}/MoveAdjacentTo.cs | 4 +- .../Activities/Move}/MoveWithinRange.cs | 4 +- .../Activities/Rearm.cs | 3 +- .../Activities/Repair.cs | 3 +- .../Activities/UnloadCargo.cs | 5 +- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 67 ++++++++++++++++++ .../Traits/Air/Aircraft.cs | 6 +- .../Traits/Air/AttackBomber.cs | 7 +- .../Traits/Air/AttackHeli.cs | 9 ++- .../Traits/Air/AttackPlane.cs | 9 ++- .../Traits/Air/FallsToEarth.cs | 5 +- .../Traits/Air/FlyAwayOnIdle.cs | 4 +- .../Traits/Air/Helicopter.cs | 4 +- .../Traits/Air/Plane.cs | 4 +- .../Traits/Air/ReturnOnIdle.cs | 4 +- .../Traits}/Armament.cs | 3 +- .../Traits}/Attack/AttackBase.cs | 3 +- .../Traits}/Attack/AttackCharge.cs | 2 +- .../Traits}/Attack/AttackFollow.cs | 2 +- .../Traits}/Attack/AttackFrontal.cs | 2 +- .../Traits}/Attack/AttackMedic.cs | 2 +- .../Traits}/Attack/AttackOmni.cs | 2 +- .../Traits}/Attack/AttackTurreted.cs | 2 +- .../Traits}/Attack/AttackWander.cs | 2 +- .../Traits/AttackMove.cs | 4 +- .../Traits}/AutoHeal.cs | 3 +- .../Traits}/AutoTarget.cs | 3 +- OpenRA.Mods.Common/Traits/Buildings/Exit.cs | 32 +++++++++ .../Traits/Buildings/Reservable.cs | 2 +- .../Traits}/Cargo.cs | 6 +- .../Traits/Cloak.cs | 3 +- .../Traits}/LimitedAmmo.cs | 2 +- .../Traits/Mobile.cs | 3 +- .../Traits}/Passenger.cs | 4 +- .../Traits}/Reloads.cs | 2 +- .../Traits}/Render/Hovers.cs | 4 +- .../Traits}/Render/RenderBuildingCharge.cs | 4 +- .../Traits}/Render/RenderBuildingTurreted.cs | 3 +- .../Traits}/Render/WithBarrel.cs | 3 +- .../Traits}/Render/WithMuzzleFlash.cs | 3 +- .../Traits}/Render/WithTurret.cs | 7 +- .../Traits}/Turreted.cs | 2 +- .../Traits/Wanders.cs | 2 +- .../Traits/World/DomainIndex.cs | 2 +- .../Traits/World/PathFinder.cs | 2 +- .../Traits/World/PathSearch.cs | 2 +- .../Traits/World/PathfinderDebugOverlay.cs | 6 +- OpenRA.Mods.Common/TraitsInterfaces.cs | 1 + OpenRA.Mods.D2k/Activities/CarryUnit.cs | 2 +- OpenRA.Mods.D2k/Traits/AttackSwallow.cs | 2 +- OpenRA.Mods.D2k/Traits/AutoCarryall.cs | 2 +- OpenRA.Mods.RA/AI/AttackOrFleeFuzzy.cs | 1 + OpenRA.Mods.RA/AI/States/AirStates.cs | 2 + OpenRA.Mods.RA/AI/States/StateBase.cs | 1 + OpenRA.Mods.RA/Activities/Demolish.cs | 3 +- .../Activities/ExternalCaptureActor.cs | 2 + OpenRA.Mods.RA/Activities/LayMines.cs | 1 + OpenRA.Mods.RA/Activities/Leap.cs | 1 + OpenRA.Mods.RA/CombatDebugOverlay.cs | 1 + OpenRA.Mods.RA/EjectOnDeath.cs | 1 + OpenRA.Mods.RA/Guard.cs | 1 + OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 68 +------------------ OpenRA.Mods.RA/ParaDrop.cs | 1 + OpenRA.Mods.RA/Production.cs | 17 +---- OpenRA.Mods.RA/RepairableNear.cs | 2 +- OpenRA.Mods.RA/ScaredyCat.cs | 1 + .../Scripting/Global/ReinforcementsGlobal.cs | 1 + .../Scripting/Properties/CombatProperties.cs | 2 +- .../Scripting/Properties/GeneralProperties.cs | 1 + .../Properties/HelicopterProperties.cs | 3 +- .../Scripting/Properties/MobileProperties.cs | 2 + .../Scripting/Properties/PlaneProperties.cs | 3 +- .../Scripting/Properties/PlayerProperties.cs | 1 + .../Properties/TransportProperties.cs | 3 +- .../SupportPowers/AirstrikePower.cs | 1 + .../SupportPowers/ParatroopersPower.cs | 1 + OpenRA.Mods.RA/TakeCover.cs | 1 + .../{ => Traits}/Attack/AttackGarrisoned.cs | 0 OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs | 1 + .../Traits/Buildings/ClonesProducedUnits.cs | 1 + .../Traits/Crates/GiveUnitCrateAction.cs | 1 + OpenRA.Mods.RA/Traits/DemoTruck.cs | 2 +- OpenRA.Mods.RA/Traits/Mine.cs | 1 + OpenRA.Mods.RA/Traits/TargetableSubmarine.cs | 1 + OpenRA.Mods.RA/Traits/TargetableUnit.cs | 1 + OpenRA.Mods.RA/TraitsInterfaces.cs | 2 - OpenRA.Mods.RA/TransformOnPassenger.cs | 1 + .../Widgets/Logic/DebugMenuLogic.cs | 1 + .../Traits/Render/WithVoxelBarrel.cs | 2 +- .../Traits/Render/WithVoxelTurret.cs | 2 +- 113 files changed, 255 insertions(+), 244 deletions(-) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/FallToEarth.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/Fly.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/FlyAttack.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/FlyCircle.cs (91%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/FlyFollow.cs (93%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/FlyTimed.cs (93%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/HeliAttack.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/HeliFly.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/HeliFlyCircle.cs (91%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/HeliLand.cs (92%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/HeliReturn.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/Land.cs (93%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/ResupplyAircraft.cs (91%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/ReturnToBase.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Air/TakeOff.cs (94%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Attack.cs (96%) mode change 100755 => 100644 rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/EnterTransport.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Heal.cs (92%) mode change 100755 => 100644 rename {OpenRA.Mods.RA/Activities => OpenRA.Mods.Common/Activities/Move}/AttackMoveActivity.cs (94%) rename {OpenRA.Mods.RA/Activities => OpenRA.Mods.Common/Activities/Move}/Follow.cs (94%) rename {OpenRA.Mods.RA/Activities => OpenRA.Mods.Common/Activities/Move}/Move.cs (98%) rename {OpenRA.Mods.RA/Activities => OpenRA.Mods.Common/Activities/Move}/MoveAdjacentTo.cs (98%) mode change 100755 => 100644 rename {OpenRA.Mods.RA/Activities => OpenRA.Mods.Common/Activities/Move}/MoveWithinRange.cs (96%) mode change 100755 => 100644 rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Rearm.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/Repair.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Activities/UnloadCargo.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/Aircraft.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/AttackBomber.cs (94%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/AttackHeli.cs (81%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/AttackPlane.cs (85%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/FallsToEarth.cs (91%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/FlyAwayOnIdle.cs (88%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/Helicopter.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/Plane.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Air/ReturnOnIdle.cs (94%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Armament.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackBase.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackCharge.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackFollow.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackFrontal.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackMedic.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackOmni.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackTurreted.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Attack/AttackWander.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/AttackMove.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/AutoHeal.cs (95%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/AutoTarget.cs (98%) create mode 100644 OpenRA.Mods.Common/Traits/Buildings/Exit.cs rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Buildings/Reservable.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Cargo.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Cloak.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/LimitedAmmo.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Mobile.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Passenger.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Reloads.cs (97%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/Hovers.cs (94%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/RenderBuildingCharge.cs (94%) mode change 100755 => 100644 rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/RenderBuildingTurreted.cs (96%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/WithBarrel.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/WithMuzzleFlash.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Render/WithTurret.cs (93%) mode change 100755 => 100644 rename {OpenRA.Mods.RA => OpenRA.Mods.Common/Traits}/Turreted.cs (98%) mode change 100755 => 100644 rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/Wanders.cs (98%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/World/DomainIndex.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/World/PathFinder.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/World/PathSearch.cs (99%) rename {OpenRA.Mods.RA => OpenRA.Mods.Common}/Traits/World/PathfinderDebugOverlay.cs (92%) rename OpenRA.Mods.RA/{ => Traits}/Attack/AttackGarrisoned.cs (100%) diff --git a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs index 17030c13ec..25895f3041 100644 --- a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs +++ b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs @@ -11,6 +11,7 @@ using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs index 81139ff05f..2931e7d628 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs @@ -12,7 +12,7 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.RA; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits diff --git a/OpenRA.Mods.RA/Activities/Air/FallToEarth.cs b/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs similarity index 95% rename from OpenRA.Mods.RA/Activities/Air/FallToEarth.cs rename to OpenRA.Mods.Common/Activities/Air/FallToEarth.cs index d5c4e328b2..3ff65257bf 100644 --- a/OpenRA.Mods.RA/Activities/Air/FallToEarth.cs +++ b/OpenRA.Mods.Common/Activities/Air/FallToEarth.cs @@ -11,10 +11,10 @@ using System.Linq; using OpenRA.Activities; using OpenRA.GameRules; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class FallToEarth : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/Fly.cs b/OpenRA.Mods.Common/Activities/Air/Fly.cs similarity index 97% rename from OpenRA.Mods.RA/Activities/Air/Fly.cs rename to OpenRA.Mods.Common/Activities/Air/Fly.cs index 6705f43998..cc5f8469c1 100644 --- a/OpenRA.Mods.RA/Activities/Air/Fly.cs +++ b/OpenRA.Mods.Common/Activities/Air/Fly.cs @@ -10,10 +10,10 @@ using System.Collections.Generic; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Fly : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/FlyAttack.cs b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs similarity index 95% rename from OpenRA.Mods.RA/Activities/Air/FlyAttack.cs rename to OpenRA.Mods.Common/Activities/Air/FlyAttack.cs index 0cf9763580..c9dd280ea7 100644 --- a/OpenRA.Mods.RA/Activities/Air/FlyAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyAttack.cs @@ -10,10 +10,10 @@ using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class FlyAttack : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/FlyCircle.cs b/OpenRA.Mods.Common/Activities/Air/FlyCircle.cs similarity index 91% rename from OpenRA.Mods.RA/Activities/Air/FlyCircle.cs rename to OpenRA.Mods.Common/Activities/Air/FlyCircle.cs index dda52a7505..eb044f302a 100644 --- a/OpenRA.Mods.RA/Activities/Air/FlyCircle.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyCircle.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class FlyCircle : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/FlyFollow.cs b/OpenRA.Mods.Common/Activities/Air/FlyFollow.cs similarity index 93% rename from OpenRA.Mods.RA/Activities/Air/FlyFollow.cs rename to OpenRA.Mods.Common/Activities/Air/FlyFollow.cs index 1ca2d4dbd8..a3beba37a5 100644 --- a/OpenRA.Mods.RA/Activities/Air/FlyFollow.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyFollow.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class FlyFollow : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/FlyTimed.cs b/OpenRA.Mods.Common/Activities/Air/FlyTimed.cs similarity index 93% rename from OpenRA.Mods.RA/Activities/Air/FlyTimed.cs rename to OpenRA.Mods.Common/Activities/Air/FlyTimed.cs index 7c90484a65..0a9c0a0259 100644 --- a/OpenRA.Mods.RA/Activities/Air/FlyTimed.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyTimed.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class FlyTimed : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/HeliAttack.cs b/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs similarity index 95% rename from OpenRA.Mods.RA/Activities/Air/HeliAttack.cs rename to OpenRA.Mods.Common/Activities/Air/HeliAttack.cs index 89a755b68d..86ccd07c30 100644 --- a/OpenRA.Mods.RA/Activities/Air/HeliAttack.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliAttack.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class HeliAttack : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/HeliFly.cs b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs similarity index 97% rename from OpenRA.Mods.RA/Activities/Air/HeliFly.cs rename to OpenRA.Mods.Common/Activities/Air/HeliFly.cs index edeccc0c45..528e9a547f 100644 --- a/OpenRA.Mods.RA/Activities/Air/HeliFly.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs @@ -10,10 +10,10 @@ using System.Collections.Generic; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class HeliFly : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/HeliFlyCircle.cs b/OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs similarity index 91% rename from OpenRA.Mods.RA/Activities/Air/HeliFlyCircle.cs rename to OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs index 6b974bfffb..ed3bb2196b 100644 --- a/OpenRA.Mods.RA/Activities/Air/HeliFlyCircle.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs @@ -11,11 +11,10 @@ using System; using System.Collections.Generic; using OpenRA.Activities; -using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class HeliFlyCircle : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/HeliLand.cs b/OpenRA.Mods.Common/Activities/Air/HeliLand.cs similarity index 92% rename from OpenRA.Mods.RA/Activities/Air/HeliLand.cs rename to OpenRA.Mods.Common/Activities/Air/HeliLand.cs index ca002572ad..e17f8a9d2c 100644 --- a/OpenRA.Mods.RA/Activities/Air/HeliLand.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliLand.cs @@ -9,9 +9,9 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class HeliLand : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/HeliReturn.cs b/OpenRA.Mods.Common/Activities/Air/HeliReturn.cs similarity index 95% rename from OpenRA.Mods.RA/Activities/Air/HeliReturn.cs rename to OpenRA.Mods.Common/Activities/Air/HeliReturn.cs index ac25e49de4..c4d5150eae 100644 --- a/OpenRA.Mods.RA/Activities/Air/HeliReturn.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliReturn.cs @@ -10,11 +10,10 @@ using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class HeliReturn : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/Land.cs b/OpenRA.Mods.Common/Activities/Air/Land.cs similarity index 93% rename from OpenRA.Mods.RA/Activities/Air/Land.cs rename to OpenRA.Mods.Common/Activities/Air/Land.cs index 1b88dce631..c3192db629 100644 --- a/OpenRA.Mods.RA/Activities/Air/Land.cs +++ b/OpenRA.Mods.Common/Activities/Air/Land.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Land : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/ResupplyAircraft.cs b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs similarity index 91% rename from OpenRA.Mods.RA/Activities/Air/ResupplyAircraft.cs rename to OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs index 4e6728e26f..047f4501fd 100644 --- a/OpenRA.Mods.RA/Activities/Air/ResupplyAircraft.cs +++ b/OpenRA.Mods.Common/Activities/Air/ResupplyAircraft.cs @@ -12,11 +12,11 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class ResupplyAircraft : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/ReturnToBase.cs b/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs similarity index 98% rename from OpenRA.Mods.RA/Activities/Air/ReturnToBase.cs rename to OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs index cfb1f04227..edbcdab667 100644 --- a/OpenRA.Mods.RA/Activities/Air/ReturnToBase.cs +++ b/OpenRA.Mods.Common/Activities/Air/ReturnToBase.cs @@ -11,10 +11,10 @@ using System; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class ReturnToBase : Activity { diff --git a/OpenRA.Mods.RA/Activities/Air/TakeOff.cs b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs similarity index 94% rename from OpenRA.Mods.RA/Activities/Air/TakeOff.cs rename to OpenRA.Mods.Common/Activities/Air/TakeOff.cs index a46121afcf..7c1ee5de69 100644 --- a/OpenRA.Mods.RA/Activities/Air/TakeOff.cs +++ b/OpenRA.Mods.Common/Activities/Air/TakeOff.cs @@ -10,10 +10,9 @@ using OpenRA.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class TakeOff : Activity { diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.Common/Activities/Attack.cs old mode 100755 new mode 100644 similarity index 96% rename from OpenRA.Mods.RA/Activities/Attack.cs rename to OpenRA.Mods.Common/Activities/Attack.cs index f5007a573f..341fd06d40 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.Common/Activities/Attack.cs @@ -9,12 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { /* non-turreted attack */ public class Attack : Activity diff --git a/OpenRA.Mods.RA/Activities/EnterTransport.cs b/OpenRA.Mods.Common/Activities/EnterTransport.cs similarity index 96% rename from OpenRA.Mods.RA/Activities/EnterTransport.cs rename to OpenRA.Mods.Common/Activities/EnterTransport.cs index 0f80aab23f..1c367017d5 100644 --- a/OpenRA.Mods.RA/Activities/EnterTransport.cs +++ b/OpenRA.Mods.Common/Activities/EnterTransport.cs @@ -9,10 +9,10 @@ #endregion using System; -using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { class EnterTransport : Enter { diff --git a/OpenRA.Mods.RA/Activities/Heal.cs b/OpenRA.Mods.Common/Activities/Heal.cs old mode 100755 new mode 100644 similarity index 92% rename from OpenRA.Mods.RA/Activities/Heal.cs rename to OpenRA.Mods.Common/Activities/Heal.cs index d7fbc0ee3b..3d5bd0f829 --- a/OpenRA.Mods.RA/Activities/Heal.cs +++ b/OpenRA.Mods.Common/Activities/Heal.cs @@ -9,10 +9,10 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Heal : Attack { diff --git a/OpenRA.Mods.RA/Activities/AttackMoveActivity.cs b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs similarity index 94% rename from OpenRA.Mods.RA/Activities/AttackMoveActivity.cs rename to OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs index 4ec3420fc3..bf13a1ab4e 100644 --- a/OpenRA.Mods.RA/Activities/AttackMoveActivity.cs +++ b/OpenRA.Mods.Common/Activities/Move/AttackMoveActivity.cs @@ -10,10 +10,10 @@ using System.Collections.Generic; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class AttackMoveActivity : Activity { diff --git a/OpenRA.Mods.RA/Activities/Follow.cs b/OpenRA.Mods.Common/Activities/Move/Follow.cs similarity index 94% rename from OpenRA.Mods.RA/Activities/Follow.cs rename to OpenRA.Mods.Common/Activities/Move/Follow.cs index 54dfb867e7..1e920bb5c9 100644 --- a/OpenRA.Mods.RA/Activities/Follow.cs +++ b/OpenRA.Mods.Common/Activities/Move/Follow.cs @@ -9,10 +9,9 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Follow : Activity { diff --git a/OpenRA.Mods.RA/Activities/Move.cs b/OpenRA.Mods.Common/Activities/Move/Move.cs similarity index 98% rename from OpenRA.Mods.RA/Activities/Move.cs rename to OpenRA.Mods.Common/Activities/Move/Move.cs index 471b61faf0..8c927dfa88 100644 --- a/OpenRA.Mods.RA/Activities/Move.cs +++ b/OpenRA.Mods.Common/Activities/Move/Move.cs @@ -13,14 +13,13 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { - class Move : Activity + public class Move : Activity { static readonly List NoPath = new List(); @@ -443,7 +442,7 @@ namespace OpenRA.Mods.RA.Activities // HACK: Dirty, but it suffices until we do something better: if (a.GetType() == typeof(Move)) return true; if (a.GetType() == typeof(MoveAdjacentTo)) return true; - if (a.GetType() == typeof(AttackMove)) return true; + if (a.GetType() == typeof(AttackMoveActivity)) return true; // Not a move: return false; diff --git a/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs old mode 100755 new mode 100644 similarity index 98% rename from OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs rename to OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs index b475270e77..49c976f7de --- a/OpenRA.Mods.RA/Activities/MoveAdjacentTo.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs @@ -12,10 +12,10 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class MoveAdjacentTo : Activity { diff --git a/OpenRA.Mods.RA/Activities/MoveWithinRange.cs b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs old mode 100755 new mode 100644 similarity index 96% rename from OpenRA.Mods.RA/Activities/MoveWithinRange.cs rename to OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs index f1975b5920..e01f335063 --- a/OpenRA.Mods.RA/Activities/MoveWithinRange.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs @@ -11,10 +11,10 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class MoveWithinRange : MoveAdjacentTo { diff --git a/OpenRA.Mods.RA/Activities/Rearm.cs b/OpenRA.Mods.Common/Activities/Rearm.cs similarity index 95% rename from OpenRA.Mods.RA/Activities/Rearm.cs rename to OpenRA.Mods.Common/Activities/Rearm.cs index 9448826618..30ed317788 100644 --- a/OpenRA.Mods.RA/Activities/Rearm.cs +++ b/OpenRA.Mods.Common/Activities/Rearm.cs @@ -11,10 +11,9 @@ using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Rearm : Activity { diff --git a/OpenRA.Mods.RA/Activities/Repair.cs b/OpenRA.Mods.Common/Activities/Repair.cs similarity index 96% rename from OpenRA.Mods.RA/Activities/Repair.cs rename to OpenRA.Mods.Common/Activities/Repair.cs index a6dc33f89a..9b010d7488 100644 --- a/OpenRA.Mods.RA/Activities/Repair.cs +++ b/OpenRA.Mods.Common/Activities/Repair.cs @@ -11,10 +11,9 @@ using System; using OpenRA.Activities; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class Repair : Activity { diff --git a/OpenRA.Mods.RA/Activities/UnloadCargo.cs b/OpenRA.Mods.Common/Activities/UnloadCargo.cs similarity index 96% rename from OpenRA.Mods.RA/Activities/UnloadCargo.cs rename to OpenRA.Mods.Common/Activities/UnloadCargo.cs index fac7cb756f..f8a684174c 100644 --- a/OpenRA.Mods.RA/Activities/UnloadCargo.cs +++ b/OpenRA.Mods.Common/Activities/UnloadCargo.cs @@ -12,12 +12,11 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Activities +namespace OpenRA.Mods.Common.Activities { public class UnloadCargo : Activity { diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 25a9d4f22c..a72cd41217 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -56,12 +56,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -121,7 +147,28 @@ + + + + + + + + + + + + + + + + + + + + + @@ -131,13 +178,17 @@ + + + + @@ -153,11 +204,14 @@ + + + @@ -181,7 +235,11 @@ + + + + @@ -189,15 +247,18 @@ + + + @@ -206,16 +267,22 @@ + + + + + + diff --git a/OpenRA.Mods.RA/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Air/Aircraft.cs rename to OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 849a2312ce..e5c64bc9ee 100644 --- a/OpenRA.Mods.RA/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -12,14 +12,12 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.Common; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; -using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Activities; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public class AircraftInfo : ITraitInfo, IFacingInfo, IOccupySpaceInfo, ICruiseAltitudeInfo, UsesInit, UsesInit { diff --git a/OpenRA.Mods.RA/Traits/Air/AttackBomber.cs b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs similarity index 94% rename from OpenRA.Mods.RA/Traits/Air/AttackBomber.cs rename to OpenRA.Mods.Common/Traits/Air/AttackBomber.cs index 8ba6b2e211..5259ff2fd0 100644 --- a/OpenRA.Mods.RA/Traits/Air/AttackBomber.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs @@ -11,12 +11,11 @@ using System; using System.Linq; using OpenRA.Activities; -using OpenRA.Mods.RA; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { - class AttackBomberInfo : AttackBaseInfo + public class AttackBomberInfo : AttackBaseInfo { [Desc("Armament name")] public readonly string Bombs = "primary"; @@ -28,7 +27,7 @@ namespace OpenRA.Mods.RA.Traits public override object Create(ActorInitializer init) { return new AttackBomber(init.self, this); } } - class AttackBomber : AttackBase, ITick, ISync, INotifyRemovedFromWorld + public class AttackBomber : AttackBase, ITick, ISync, INotifyRemovedFromWorld { AttackBomberInfo info; [Sync] Target target; diff --git a/OpenRA.Mods.RA/Traits/Air/AttackHeli.cs b/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs similarity index 81% rename from OpenRA.Mods.RA/Traits/Air/AttackHeli.cs rename to OpenRA.Mods.Common/Traits/Air/AttackHeli.cs index 0b91d2d4e1..f03806c36d 100644 --- a/OpenRA.Mods.RA/Traits/Air/AttackHeli.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs @@ -9,18 +9,17 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { - class AttackHeliInfo : AttackFrontalInfo + public class AttackHeliInfo : AttackFrontalInfo { public override object Create(ActorInitializer init) { return new AttackHeli(init.self, this); } } - class AttackHeli : AttackFrontal + public class AttackHeli : AttackFrontal { public AttackHeli(Actor self, AttackHeliInfo info) : base(self, info) { } diff --git a/OpenRA.Mods.RA/Traits/Air/AttackPlane.cs b/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs similarity index 85% rename from OpenRA.Mods.RA/Traits/Air/AttackPlane.cs rename to OpenRA.Mods.Common/Traits/Air/AttackPlane.cs index d98e3c470b..201a5a2f06 100644 --- a/OpenRA.Mods.RA/Traits/Air/AttackPlane.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs @@ -9,18 +9,17 @@ #endregion using OpenRA.Activities; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { - class AttackPlaneInfo : AttackFrontalInfo + public class AttackPlaneInfo : AttackFrontalInfo { public override object Create(ActorInitializer init) { return new AttackPlane(init.self, this); } } - class AttackPlane : AttackFrontal + public class AttackPlane : AttackFrontal { public AttackPlane(Actor self, AttackPlaneInfo info) : base(self, info) { } diff --git a/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs similarity index 91% rename from OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs rename to OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs index f7bf760e5e..bb6aa5efe1 100644 --- a/OpenRA.Mods.RA/Traits/Air/FallsToEarth.cs +++ b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs @@ -10,11 +10,10 @@ using System.Linq; using OpenRA.GameRules; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Causes aircraft husks that are spawned in the air to crash to the ground.")] public class FallsToEarthInfo : ITraitInfo diff --git a/OpenRA.Mods.RA/Traits/Air/FlyAwayOnIdle.cs b/OpenRA.Mods.Common/Traits/Air/FlyAwayOnIdle.cs similarity index 88% rename from OpenRA.Mods.RA/Traits/Air/FlyAwayOnIdle.cs rename to OpenRA.Mods.Common/Traits/Air/FlyAwayOnIdle.cs index 8a324b4645..f514c1c63e 100644 --- a/OpenRA.Mods.RA/Traits/Air/FlyAwayOnIdle.cs +++ b/OpenRA.Mods.Common/Traits/Air/FlyAwayOnIdle.cs @@ -9,11 +9,9 @@ #endregion using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Leave the map when idle.")] class FlyAwayOnIdleInfo : TraitInfo { } diff --git a/OpenRA.Mods.RA/Traits/Air/Helicopter.cs b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Air/Helicopter.cs rename to OpenRA.Mods.Common/Traits/Air/Helicopter.cs index 4be0b571ae..71fe64945b 100644 --- a/OpenRA.Mods.RA/Traits/Air/Helicopter.cs +++ b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs @@ -14,11 +14,9 @@ using System.Drawing; using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public class HelicopterInfo : AircraftInfo, IMoveInfo { diff --git a/OpenRA.Mods.RA/Traits/Air/Plane.cs b/OpenRA.Mods.Common/Traits/Air/Plane.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Air/Plane.cs rename to OpenRA.Mods.Common/Traits/Air/Plane.cs index 28ba03c1a9..827894d70f 100644 --- a/OpenRA.Mods.RA/Traits/Air/Plane.cs +++ b/OpenRA.Mods.Common/Traits/Air/Plane.cs @@ -12,11 +12,9 @@ using System; using System.Drawing; using OpenRA.Activities; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public class PlaneInfo : AircraftInfo, IMoveInfo { diff --git a/OpenRA.Mods.RA/Traits/Air/ReturnOnIdle.cs b/OpenRA.Mods.Common/Traits/Air/ReturnOnIdle.cs similarity index 94% rename from OpenRA.Mods.RA/Traits/Air/ReturnOnIdle.cs rename to OpenRA.Mods.Common/Traits/Air/ReturnOnIdle.cs index 52b490989e..53d0a1e1e9 100644 --- a/OpenRA.Mods.RA/Traits/Air/ReturnOnIdle.cs +++ b/OpenRA.Mods.Common/Traits/Air/ReturnOnIdle.cs @@ -10,11 +10,9 @@ using System.Linq; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Return to a player owned RearmBuildings. If none available, head back to base and circle over it.")] class ReturnOnIdleInfo : TraitInfo { } diff --git a/OpenRA.Mods.RA/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs similarity index 99% rename from OpenRA.Mods.RA/Armament.cs rename to OpenRA.Mods.Common/Traits/Armament.cs index 83d53a6755..3da3069d54 100644 --- a/OpenRA.Mods.RA/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -12,11 +12,10 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.GameRules; -using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public class Barrel { diff --git a/OpenRA.Mods.RA/Attack/AttackBase.cs b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs similarity index 99% rename from OpenRA.Mods.RA/Attack/AttackBase.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackBase.cs index cc75ffbec3..6b1650c37d 100644 --- a/OpenRA.Mods.RA/Attack/AttackBase.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs @@ -15,10 +15,9 @@ using System.Linq; using OpenRA.Activities; using OpenRA.GameRules; using OpenRA.Mods.Common; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public abstract class AttackBaseInfo : ITraitInfo { diff --git a/OpenRA.Mods.RA/Attack/AttackCharge.cs b/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs similarity index 98% rename from OpenRA.Mods.RA/Attack/AttackCharge.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs index c0c71977bf..cff9d2a63d 100644 --- a/OpenRA.Mods.RA/Attack/AttackCharge.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs @@ -12,7 +12,7 @@ using OpenRA.Activities; using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Charges up before being able to attack.")] class AttackChargeInfo : AttackOmniInfo diff --git a/OpenRA.Mods.RA/Attack/AttackFollow.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs similarity index 98% rename from OpenRA.Mods.RA/Attack/AttackFollow.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs index 27ab263dd4..a797c51585 100644 --- a/OpenRA.Mods.RA/Attack/AttackFollow.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs @@ -12,7 +12,7 @@ using System; using OpenRA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Actor will follow units until in range to attack them.")] public class AttackFollowInfo : AttackBaseInfo diff --git a/OpenRA.Mods.RA/Attack/AttackFrontal.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs similarity index 97% rename from OpenRA.Mods.RA/Attack/AttackFrontal.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs index d7f37d5907..502f89b9c6 100644 --- a/OpenRA.Mods.RA/Attack/AttackFrontal.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs @@ -12,7 +12,7 @@ using System; using OpenRA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Unit got to face the target")] public class AttackFrontalInfo : AttackBaseInfo, Requires diff --git a/OpenRA.Mods.RA/Attack/AttackMedic.cs b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs similarity index 97% rename from OpenRA.Mods.RA/Attack/AttackMedic.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs index 8363c9fef0..c9d4451a3f 100644 --- a/OpenRA.Mods.RA/Attack/AttackMedic.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs @@ -11,7 +11,7 @@ using OpenRA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Give the unit a \"heal-weapon\" that attacks friendly targets if they are damaged.", "It conflicts with any other weapon or Attack*: trait because it will hurt friendlies during the", diff --git a/OpenRA.Mods.RA/Attack/AttackOmni.cs b/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs similarity index 97% rename from OpenRA.Mods.RA/Attack/AttackOmni.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs index 28ccf2d924..34532bbf58 100644 --- a/OpenRA.Mods.RA/Attack/AttackOmni.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs @@ -11,7 +11,7 @@ using OpenRA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { class AttackOmniInfo : AttackBaseInfo { diff --git a/OpenRA.Mods.RA/Attack/AttackTurreted.cs b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs similarity index 97% rename from OpenRA.Mods.RA/Attack/AttackTurreted.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs index 8d280f1997..b8e70abefc 100644 --- a/OpenRA.Mods.RA/Attack/AttackTurreted.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using OpenRA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Actor has a visual turret used to attack.")] public class AttackTurretedInfo : AttackFollowInfo, Requires diff --git a/OpenRA.Mods.RA/Attack/AttackWander.cs b/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs similarity index 96% rename from OpenRA.Mods.RA/Attack/AttackWander.cs rename to OpenRA.Mods.Common/Traits/Attack/AttackWander.cs index 1c586fdf69..37fc2bf09d 100644 --- a/OpenRA.Mods.RA/Attack/AttackWander.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs @@ -10,7 +10,7 @@ using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Will AttackMove to a random location within MoveRadius when idle.", "This conflicts with player orders and should only be added to animal creeps.")] diff --git a/OpenRA.Mods.RA/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs similarity index 96% rename from OpenRA.Mods.RA/Traits/AttackMove.cs rename to OpenRA.Mods.Common/Traits/AttackMove.cs index f49f3419f6..94cb9e5e27 100644 --- a/OpenRA.Mods.RA/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -10,10 +10,10 @@ using System.Collections.Generic; using System.Drawing; -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Provides access to the attack-move command, which will make the actor automatically engage viable targets while moving to the destination.")] class AttackMoveInfo : ITraitInfo diff --git a/OpenRA.Mods.RA/AutoHeal.cs b/OpenRA.Mods.Common/Traits/AutoHeal.cs similarity index 95% rename from OpenRA.Mods.RA/AutoHeal.cs rename to OpenRA.Mods.Common/Traits/AutoHeal.cs index 8a2af9fa97..06501306ed 100644 --- a/OpenRA.Mods.RA/AutoHeal.cs +++ b/OpenRA.Mods.Common/Traits/AutoHeal.cs @@ -9,10 +9,9 @@ #endregion using System.Linq; -using OpenRA.Mods.Common; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Used together with AttackMedic: to make the healer do it's job automatically to nearby units.")] class AutoHealInfo : TraitInfo, Requires { } diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.Common/Traits/AutoTarget.cs similarity index 98% rename from OpenRA.Mods.RA/AutoTarget.cs rename to OpenRA.Mods.Common/Traits/AutoTarget.cs index ea57c8f494..24dbd852ec 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.Common/Traits/AutoTarget.cs @@ -10,10 +10,9 @@ using System.Drawing; using System.Linq; -using OpenRA.Mods.Common; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("The actor will automatically engage the enemy when it is in range.")] public class AutoTargetInfo : ITraitInfo, Requires diff --git a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs new file mode 100644 index 0000000000..51253ac406 --- /dev/null +++ b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs @@ -0,0 +1,32 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System.Collections.Generic; +using OpenRA.Mods.Common.Effects; +using OpenRA.Traits; + +namespace OpenRA.Mods.Common.Traits +{ + [Desc("Where the unit should leave the building. Multiples are allowed if IDs are added: Exit@2, ...")] + public class ExitInfo : TraitInfo + { + [Desc("Offset at which that the exiting actor is spawned")] + public readonly WVec SpawnOffset = WVec.Zero; + + [Desc("Cell offset where the exiting actor enters the ActorMap")] + public readonly CVec ExitCell = CVec.Zero; + public readonly int Facing = -1; + + [Desc("AttackMove to a RallyPoint or stay where you are spawned.")] + public readonly bool MoveIntoWorld = true; + } + + public class Exit { } +} diff --git a/OpenRA.Mods.RA/Traits/Buildings/Reservable.cs b/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Buildings/Reservable.cs rename to OpenRA.Mods.Common/Traits/Buildings/Reservable.cs index 37e4b47fda..09ee2b29e0 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/Reservable.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Reservable.cs @@ -12,7 +12,7 @@ using System; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Reserve landing places for aircraft.")] class ReservableInfo : TraitInfo { } diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.Common/Traits/Cargo.cs similarity index 98% rename from OpenRA.Mods.RA/Cargo.cs rename to OpenRA.Mods.Common/Traits/Cargo.cs index 62fe21bc00..f18aea17d4 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.Common/Traits/Cargo.cs @@ -11,14 +11,12 @@ using System; using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; -using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Traits; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common.Traits { [Desc("This actor can transport Passenger actors.")] public class CargoInfo : ITraitInfo, Requires diff --git a/OpenRA.Mods.RA/Traits/Cloak.cs b/OpenRA.Mods.Common/Traits/Cloak.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Cloak.cs rename to OpenRA.Mods.Common/Traits/Cloak.cs index 0e086e7141..5f22d59ca5 100644 --- a/OpenRA.Mods.RA/Traits/Cloak.cs +++ b/OpenRA.Mods.Common/Traits/Cloak.cs @@ -13,10 +13,9 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("This unit can cloak and uncloak in specific situations.")] public class CloakInfo : UpgradableTraitInfo, ITraitInfo diff --git a/OpenRA.Mods.RA/LimitedAmmo.cs b/OpenRA.Mods.Common/Traits/LimitedAmmo.cs similarity index 98% rename from OpenRA.Mods.RA/LimitedAmmo.cs rename to OpenRA.Mods.Common/Traits/LimitedAmmo.cs index e56305e9cc..5ebdf7b012 100644 --- a/OpenRA.Mods.RA/LimitedAmmo.cs +++ b/OpenRA.Mods.Common/Traits/LimitedAmmo.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Actor has a limited amount of ammo, after using it all the actor must reload in some way.")] public class LimitedAmmoInfo : ITraitInfo diff --git a/OpenRA.Mods.RA/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs similarity index 99% rename from OpenRA.Mods.RA/Traits/Mobile.cs rename to OpenRA.Mods.Common/Traits/Mobile.cs index a27af81fc9..14165f4437 100644 --- a/OpenRA.Mods.RA/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -15,11 +15,10 @@ using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA.Activities; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Flags] public enum CellConditions diff --git a/OpenRA.Mods.RA/Passenger.cs b/OpenRA.Mods.Common/Traits/Passenger.cs similarity index 98% rename from OpenRA.Mods.RA/Passenger.cs rename to OpenRA.Mods.Common/Traits/Passenger.cs index 5e0efab180..517cbee614 100644 --- a/OpenRA.Mods.RA/Passenger.cs +++ b/OpenRA.Mods.Common/Traits/Passenger.cs @@ -12,11 +12,11 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA +namespace OpenRA.Mods.Common.Traits { public enum AlternateTransportsMode { None, Force, Default, Always } diff --git a/OpenRA.Mods.RA/Reloads.cs b/OpenRA.Mods.Common/Traits/Reloads.cs similarity index 97% rename from OpenRA.Mods.RA/Reloads.cs rename to OpenRA.Mods.Common/Traits/Reloads.cs index 708c8e546f..5e218f46a9 100644 --- a/OpenRA.Mods.RA/Reloads.cs +++ b/OpenRA.Mods.Common/Traits/Reloads.cs @@ -10,7 +10,7 @@ using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Unit will reload its limited ammo itself.")] public class ReloadsInfo : ITraitInfo, Requires diff --git a/OpenRA.Mods.RA/Render/Hovers.cs b/OpenRA.Mods.Common/Traits/Render/Hovers.cs similarity index 94% rename from OpenRA.Mods.RA/Render/Hovers.cs rename to OpenRA.Mods.Common/Traits/Render/Hovers.cs index bd8348ec00..c4ffebee27 100644 --- a/OpenRA.Mods.RA/Render/Hovers.cs +++ b/OpenRA.Mods.Common/Traits/Render/Hovers.cs @@ -12,10 +12,10 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Changes the visual Z position periodically.")] class HoversInfo : ITraitInfo, Requires diff --git a/OpenRA.Mods.RA/Render/RenderBuildingCharge.cs b/OpenRA.Mods.Common/Traits/Render/RenderBuildingCharge.cs old mode 100755 new mode 100644 similarity index 94% rename from OpenRA.Mods.RA/Render/RenderBuildingCharge.cs rename to OpenRA.Mods.Common/Traits/Render/RenderBuildingCharge.cs index 27a24ee655..de3ef932b3 --- a/OpenRA.Mods.RA/Render/RenderBuildingCharge.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderBuildingCharge.cs @@ -8,9 +8,7 @@ */ #endregion -using OpenRA.Mods.Common.Traits; - -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Used for tesla coil and obelisk.")] public class RenderBuildingChargeInfo : RenderBuildingInfo diff --git a/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs b/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs similarity index 96% rename from OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs rename to OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs index d2515a59ee..45e1d626cb 100644 --- a/OpenRA.Mods.RA/Render/RenderBuildingTurreted.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs @@ -13,10 +13,9 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { class RenderBuildingTurretedInfo : RenderBuildingInfo, Requires { diff --git a/OpenRA.Mods.RA/Render/WithBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs similarity index 98% rename from OpenRA.Mods.RA/Render/WithBarrel.cs rename to OpenRA.Mods.Common/Traits/Render/WithBarrel.cs index e2c35170fd..94c90e2600 100644 --- a/OpenRA.Mods.RA/Render/WithBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs @@ -12,10 +12,9 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Renders barrels for units with the Turreted trait.")] class WithBarrelInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires diff --git a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs similarity index 98% rename from OpenRA.Mods.RA/Render/WithMuzzleFlash.cs rename to OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs index 6f090195a3..15310a8094 100644 --- a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs @@ -12,10 +12,9 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Renders the MuzzleSequence from the Armament trait.")] class WithMuzzleFlashInfo : ITraitInfo, Requires, Requires, Requires diff --git a/OpenRA.Mods.RA/Render/WithTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs old mode 100755 new mode 100644 similarity index 93% rename from OpenRA.Mods.RA/Render/WithTurret.cs rename to OpenRA.Mods.Common/Traits/Render/WithTurret.cs index a376244dab..409dc1475a --- a/OpenRA.Mods.RA/Render/WithTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs @@ -12,13 +12,12 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.Common.Traits; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Renders turrets for units with the Turreted trait.")] - class WithTurretInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires, Requires + public class WithTurretInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires, Requires { [Desc("Sequence name to use")] public readonly string Sequence = "turret"; @@ -49,7 +48,7 @@ namespace OpenRA.Mods.RA.Traits } } - class WithTurret : ITick + public class WithTurret : ITick { WithTurretInfo info; RenderSprites rs; diff --git a/OpenRA.Mods.RA/Turreted.cs b/OpenRA.Mods.Common/Traits/Turreted.cs old mode 100755 new mode 100644 similarity index 98% rename from OpenRA.Mods.RA/Turreted.cs rename to OpenRA.Mods.Common/Traits/Turreted.cs index 00ec740ff3..f7c2019b81 --- a/OpenRA.Mods.RA/Turreted.cs +++ b/OpenRA.Mods.Common/Traits/Turreted.cs @@ -11,7 +11,7 @@ using System; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public class TurretedInfo : ITraitInfo, UsesInit { diff --git a/OpenRA.Mods.RA/Traits/Wanders.cs b/OpenRA.Mods.Common/Traits/Wanders.cs similarity index 98% rename from OpenRA.Mods.RA/Traits/Wanders.cs rename to OpenRA.Mods.Common/Traits/Wanders.cs index dbd529846b..b6ef434eb4 100644 --- a/OpenRA.Mods.RA/Traits/Wanders.cs +++ b/OpenRA.Mods.Common/Traits/Wanders.cs @@ -11,7 +11,7 @@ using System; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Wanders around aimlessly while idle.")] abstract class WandersInfo : ITraitInfo diff --git a/OpenRA.Mods.RA/Traits/World/DomainIndex.cs b/OpenRA.Mods.Common/Traits/World/DomainIndex.cs similarity index 99% rename from OpenRA.Mods.RA/Traits/World/DomainIndex.cs rename to OpenRA.Mods.Common/Traits/World/DomainIndex.cs index 3f0b57405d..1b091bd1b0 100644 --- a/OpenRA.Mods.RA/Traits/World/DomainIndex.cs +++ b/OpenRA.Mods.Common/Traits/World/DomainIndex.cs @@ -16,7 +16,7 @@ using OpenRA.Graphics; using OpenRA.Support; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Identify untraversable regions of the map for faster pathfinding, especially with AI.", "This trait is required. Every mod needs it attached to the world actor.")] diff --git a/OpenRA.Mods.RA/Traits/World/PathFinder.cs b/OpenRA.Mods.Common/Traits/World/PathFinder.cs similarity index 99% rename from OpenRA.Mods.RA/Traits/World/PathFinder.cs rename to OpenRA.Mods.Common/Traits/World/PathFinder.cs index ad4fd65644..4e78f8cbc5 100644 --- a/OpenRA.Mods.RA/Traits/World/PathFinder.cs +++ b/OpenRA.Mods.Common/Traits/World/PathFinder.cs @@ -17,7 +17,7 @@ using OpenRA.Primitives; using OpenRA.Support; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Calculates routes for mobile units based on the A* search algorithm.", " Attach this to the world actor.")] public class PathFinderInfo : ITraitInfo diff --git a/OpenRA.Mods.RA/Traits/World/PathSearch.cs b/OpenRA.Mods.Common/Traits/World/PathSearch.cs similarity index 99% rename from OpenRA.Mods.RA/Traits/World/PathSearch.cs rename to OpenRA.Mods.Common/Traits/World/PathSearch.cs index 2d69b31116..323bbf0581 100644 --- a/OpenRA.Mods.RA/Traits/World/PathSearch.cs +++ b/OpenRA.Mods.Common/Traits/World/PathSearch.cs @@ -15,7 +15,7 @@ using System.Linq; using OpenRA; using OpenRA.Primitives; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { public sealed class PathSearch : IDisposable { diff --git a/OpenRA.Mods.RA/Traits/World/PathfinderDebugOverlay.cs b/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs similarity index 92% rename from OpenRA.Mods.RA/Traits/World/PathfinderDebugOverlay.cs rename to OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs index 1b6f66b6a9..fd67a716d3 100644 --- a/OpenRA.Mods.RA/Traits/World/PathfinderDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs @@ -16,11 +16,11 @@ using OpenRA.Graphics; using OpenRA.Primitives; using OpenRA.Traits; -namespace OpenRA.Mods.RA.Traits +namespace OpenRA.Mods.Common.Traits { [Desc("Required for the A* PathDebug from DeveloperMode. Attach this to the world actor.")] - class PathfinderDebugOverlayInfo : TraitInfo { } - class PathfinderDebugOverlay : IRenderOverlay, IWorldLoaded + public class PathfinderDebugOverlayInfo : TraitInfo { } + public class PathfinderDebugOverlay : IRenderOverlay, IWorldLoaded { Dictionary> layers; int refreshTick; diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index bf8b512b43..534743050a 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -26,6 +26,7 @@ namespace OpenRA.Mods.Common.Traits IEnumerable Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition); } + public interface INotifyAttack { void Attacking(Actor self, Target target, Armament a, Barrel barrel); } public interface INotifyChat { bool OnChat(string from, string message); } public interface INotifyParachuteLanded { void OnLanded(); } public interface IRenderActorPreviewInfo { IEnumerable RenderPreview(ActorPreviewInitializer init); } diff --git a/OpenRA.Mods.D2k/Activities/CarryUnit.cs b/OpenRA.Mods.D2k/Activities/CarryUnit.cs index 4fac08f4f2..fa3176fe4a 100644 --- a/OpenRA.Mods.D2k/Activities/CarryUnit.cs +++ b/OpenRA.Mods.D2k/Activities/CarryUnit.cs @@ -10,9 +10,9 @@ using OpenRA.Activities; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.D2k.Traits; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Traits; using OpenRA.Traits; namespace OpenRA.Mods.D2k.Activities diff --git a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs index 26c66e31d4..fa52ff69d7 100644 --- a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs +++ b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs @@ -9,7 +9,7 @@ #endregion using OpenRA.Mods.D2k.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits diff --git a/OpenRA.Mods.D2k/Traits/AutoCarryall.cs b/OpenRA.Mods.D2k/Traits/AutoCarryall.cs index e012a18ad5..df08f4e34c 100644 --- a/OpenRA.Mods.D2k/Traits/AutoCarryall.cs +++ b/OpenRA.Mods.D2k/Traits/AutoCarryall.cs @@ -11,10 +11,10 @@ using System; using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Mods.D2k.Activities; using OpenRA.Mods.RA; -using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/AI/AttackOrFleeFuzzy.cs b/OpenRA.Mods.RA/AI/AttackOrFleeFuzzy.cs index 6b1533d45e..afccefc41a 100644 --- a/OpenRA.Mods.RA/AI/AttackOrFleeFuzzy.cs +++ b/OpenRA.Mods.RA/AI/AttackOrFleeFuzzy.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Linq; using AI.Fuzzy.Library; using OpenRA.GameRules; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/AI/States/AirStates.cs b/OpenRA.Mods.RA/AI/States/AirStates.cs index 12ca987d88..ace5ed7f22 100644 --- a/OpenRA.Mods.RA/AI/States/AirStates.cs +++ b/OpenRA.Mods.RA/AI/States/AirStates.cs @@ -10,6 +10,8 @@ using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/AI/States/StateBase.cs b/OpenRA.Mods.RA/AI/States/StateBase.cs index 84b5ae36c9..6d42851120 100644 --- a/OpenRA.Mods.RA/AI/States/StateBase.cs +++ b/OpenRA.Mods.RA/AI/States/StateBase.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; diff --git a/OpenRA.Mods.RA/Activities/Demolish.cs b/OpenRA.Mods.RA/Activities/Demolish.cs index 69b0b64063..134ef58bc7 100644 --- a/OpenRA.Mods.RA/Activities/Demolish.cs +++ b/OpenRA.Mods.RA/Activities/Demolish.cs @@ -12,8 +12,9 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Effects; using OpenRA.Mods.Common.Activities; -using OpenRA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; +using OpenRA.Traits; namespace OpenRA.Mods.RA.Activities { diff --git a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs index 1abdcbc376..44672f633f 100644 --- a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs @@ -10,6 +10,8 @@ using OpenRA.Activities; using OpenRA.Effects; +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Activities/LayMines.cs b/OpenRA.Mods.RA/Activities/LayMines.cs index 0a84e9e9dc..39f4b0c3ca 100644 --- a/OpenRA.Mods.RA/Activities/LayMines.cs +++ b/OpenRA.Mods.RA/Activities/LayMines.cs @@ -11,6 +11,7 @@ using System.Linq; using OpenRA.Activities; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Activities/Leap.cs b/OpenRA.Mods.RA/Activities/Leap.cs index 3b4fccbab2..0e46f43954 100644 --- a/OpenRA.Mods.RA/Activities/Leap.cs +++ b/OpenRA.Mods.RA/Activities/Leap.cs @@ -12,6 +12,7 @@ using System; using System.Linq; using OpenRA.Activities; using OpenRA.GameRules; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/CombatDebugOverlay.cs b/OpenRA.Mods.RA/CombatDebugOverlay.cs index 5721e03dbb..ce3faf2a02 100644 --- a/OpenRA.Mods.RA/CombatDebugOverlay.cs +++ b/OpenRA.Mods.RA/CombatDebugOverlay.cs @@ -12,6 +12,7 @@ using System; using System.Drawing; using OpenRA.Graphics; using OpenRA.Mods.Common.Effects; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Traits; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/EjectOnDeath.cs b/OpenRA.Mods.RA/EjectOnDeath.cs index f317ff3c85..66217ec229 100644 --- a/OpenRA.Mods.RA/EjectOnDeath.cs +++ b/OpenRA.Mods.RA/EjectOnDeath.cs @@ -8,6 +8,7 @@ */ #endregion +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Effects; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Guard.cs b/OpenRA.Mods.RA/Guard.cs index e2efc38da0..0c555ca072 100644 --- a/OpenRA.Mods.RA/Guard.cs +++ b/OpenRA.Mods.RA/Guard.cs @@ -13,6 +13,7 @@ using System.Drawing; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 62cfe000c6..47bc1ee77c 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -79,51 +79,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -133,16 +108,7 @@ - - - - - - - - - @@ -150,7 +116,6 @@ - @@ -177,7 +142,6 @@ - @@ -185,35 +149,25 @@ - - - - - - - - - - @@ -221,7 +175,6 @@ - @@ -242,15 +195,6 @@ - - - - - - - - - @@ -258,9 +202,7 @@ - - @@ -268,7 +210,6 @@ - @@ -309,14 +250,11 @@ - - - @@ -329,8 +267,7 @@ - - + @@ -345,7 +282,6 @@ - @@ -387,8 +323,6 @@ - - diff --git a/OpenRA.Mods.RA/ParaDrop.cs b/OpenRA.Mods.RA/ParaDrop.cs index ea00a39d6b..ce3fc81e2b 100644 --- a/OpenRA.Mods.RA/ParaDrop.cs +++ b/OpenRA.Mods.RA/ParaDrop.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Effects; using OpenRA.Mods.RA.Traits; diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index 80be425522..363246b7fc 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -12,6 +12,7 @@ using System; using System.Drawing; using System.Linq; using OpenRA.Activities; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Primitives; @@ -28,22 +29,6 @@ namespace OpenRA.Mods.RA.Traits public virtual object Create(ActorInitializer init) { return new Production(this, init.self); } } - [Desc("Where the unit should leave the building. Multiples are allowed if IDs are added: Exit@2, ...")] - public class ExitInfo : TraitInfo - { - [Desc("Offset at which that the exiting actor is spawned")] - public readonly WVec SpawnOffset = WVec.Zero; - - [Desc("Cell offset where the exiting actor enters the ActorMap")] - public readonly CVec ExitCell = CVec.Zero; - public readonly int Facing = -1; - - [Desc("AttackMove to a RallyPoint or stay where you are spawned.")] - public readonly bool MoveIntoWorld = true; - } - - public class Exit { } - public class Production { Lazy rp; diff --git a/OpenRA.Mods.RA/RepairableNear.cs b/OpenRA.Mods.RA/RepairableNear.cs index 284ec445a7..1a33a29708 100644 --- a/OpenRA.Mods.RA/RepairableNear.cs +++ b/OpenRA.Mods.RA/RepairableNear.cs @@ -11,9 +11,9 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; using OpenRA.Mods.Common.Traits; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/ScaredyCat.cs b/OpenRA.Mods.RA/ScaredyCat.cs index dcd76084de..ba4b39f55e 100644 --- a/OpenRA.Mods.RA/ScaredyCat.cs +++ b/OpenRA.Mods.RA/ScaredyCat.cs @@ -8,6 +8,7 @@ */ #endregion +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs index 2c0f4c66b8..54a8061478 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs @@ -16,6 +16,7 @@ using OpenRA; using OpenRA.Activities; using OpenRA.Effects; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Primitives; diff --git a/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs index 8a5ea4565e..663fa9914b 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs @@ -13,8 +13,8 @@ using System.Linq; using Eluant; using OpenRA.Activities; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs index c0bfa67261..5ad9b87449 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs @@ -10,6 +10,7 @@ using Eluant; using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs index 748e77731c..c6e18430c1 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs @@ -8,7 +8,8 @@ */ #endregion -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs index 06d2ecfef6..473e15d2c8 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs @@ -8,6 +8,8 @@ */ #endregion +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs index 86ad602202..8cd513ad2f 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs @@ -8,7 +8,8 @@ */ #endregion -using OpenRA.Mods.RA.Activities; +using OpenRA.Mods.Common.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs index 993ff4aab1..d089bc34ae 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs @@ -11,6 +11,7 @@ using System; using System.Linq; using Eluant; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Scripting; diff --git a/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs index 0656503b67..3e6c83b107 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs @@ -10,8 +10,7 @@ using System.Linq; using OpenRA.Mods.Common.Activities; -using OpenRA.Mods.RA.Activities; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Scripting; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs index ef2277c82b..600b2df0eb 100644 --- a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Effects; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs index e1de2258a7..4ec466df30 100644 --- a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Effects; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/TakeCover.cs b/OpenRA.Mods.RA/TakeCover.cs index e5895c1497..64837c3e87 100644 --- a/OpenRA.Mods.RA/TakeCover.cs +++ b/OpenRA.Mods.RA/TakeCover.cs @@ -9,6 +9,7 @@ #endregion using OpenRA.GameRules; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Attack/AttackGarrisoned.cs b/OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs similarity index 100% rename from OpenRA.Mods.RA/Attack/AttackGarrisoned.cs rename to OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs diff --git a/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs b/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs index 3ad447a99e..79072c36f2 100644 --- a/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs +++ b/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs @@ -9,6 +9,7 @@ #endregion using OpenRA.Activities; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs index 362d71f063..e39e20de87 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs @@ -10,6 +10,7 @@ using System; using System.Linq; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs index c4afc30156..cce7d9ab5b 100644 --- a/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Linq; +using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Traits/DemoTruck.cs b/OpenRA.Mods.RA/Traits/DemoTruck.cs index ed132ff254..879f3017c4 100644 --- a/OpenRA.Mods.RA/Traits/DemoTruck.cs +++ b/OpenRA.Mods.RA/Traits/DemoTruck.cs @@ -12,8 +12,8 @@ using System.Collections.Generic; using System.Drawing; using OpenRA.Activities; using OpenRA.Mods.Common; +using OpenRA.Mods.Common.Activities; using OpenRA.Mods.Common.Orders; -using OpenRA.Mods.RA.Activities; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Traits/Mine.cs b/OpenRA.Mods.RA/Traits/Mine.cs index d51ba1c362..d37545222a 100644 --- a/OpenRA.Mods.RA/Traits/Mine.cs +++ b/OpenRA.Mods.RA/Traits/Mine.cs @@ -9,6 +9,7 @@ #endregion using System.Linq; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs b/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs index 7b3718f804..b1bbfd9250 100644 --- a/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs +++ b/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs @@ -8,6 +8,7 @@ */ #endregion +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/Traits/TargetableUnit.cs b/OpenRA.Mods.RA/Traits/TargetableUnit.cs index b289a670c4..4c42f28201 100644 --- a/OpenRA.Mods.RA/Traits/TargetableUnit.cs +++ b/OpenRA.Mods.RA/Traits/TargetableUnit.cs @@ -9,6 +9,7 @@ #endregion using System.Collections.Generic; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.RA.Traits diff --git a/OpenRA.Mods.RA/TraitsInterfaces.cs b/OpenRA.Mods.RA/TraitsInterfaces.cs index 519cb4457d..649b0dc0e8 100755 --- a/OpenRA.Mods.RA/TraitsInterfaces.cs +++ b/OpenRA.Mods.RA/TraitsInterfaces.cs @@ -27,6 +27,4 @@ namespace OpenRA.Mods.RA { void OnDock(Actor self, Actor harv, DeliverResources dockOrder); } - - public interface INotifyAttack { void Attacking(Actor self, Target target, Armament a, Barrel barrel); } } diff --git a/OpenRA.Mods.RA/TransformOnPassenger.cs b/OpenRA.Mods.RA/TransformOnPassenger.cs index 59cc2dce34..f4bc36f5e8 100644 --- a/OpenRA.Mods.RA/TransformOnPassenger.cs +++ b/OpenRA.Mods.RA/TransformOnPassenger.cs @@ -9,6 +9,7 @@ #endregion using System.Linq; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Activities; using OpenRA.Traits; diff --git a/OpenRA.Mods.RA/Widgets/Logic/DebugMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DebugMenuLogic.cs index 0eee3235cc..ba30f53ed6 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DebugMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DebugMenuLogic.cs @@ -9,6 +9,7 @@ #endregion using System; +using OpenRA.Mods.Common.Traits; using OpenRA.Mods.RA.Traits; using OpenRA.Support; using OpenRA.Traits; diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs index 18b70582ff..3d6acc8f04 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs index 8856039d3f..13cb7e88cb 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; using System.Linq; using OpenRA.Graphics; using OpenRA.Mods.Common.Graphics; -using OpenRA.Mods.RA.Traits; +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits From cb3ba37462e4dffe447eb76db91e3370a69d762f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 4 Jan 2015 04:21:44 +0100 Subject: [PATCH 2/2] StyleCop fixes --- OpenRA.Mods.Common/Activities/Move/Move.cs | 122 +++++++++--------- .../Activities/Move/MoveAdjacentTo.cs | 12 +- .../Activities/Move/MoveWithinRange.cs | 6 +- OpenRA.Mods.Common/Traits/Armament.cs | 24 ++-- OpenRA.Mods.Common/Traits/LimitedAmmo.cs | 16 +-- OpenRA.Mods.Common/Traits/Mobile.cs | 78 +++++------ OpenRA.Mods.Common/Traits/Reloads.cs | 12 +- OpenRA.Mods.Common/Traits/World/PathFinder.cs | 36 +++--- OpenRA.Mods.Common/Traits/World/PathSearch.cs | 8 +- OpenRA.Mods.D2k/Traits/AttackSwallow.cs | 2 +- .../Activities/ExternalCaptureActor.cs | 4 +- OpenRA.Mods.RA/Activities/Leap.cs | 8 +- .../Scripting/Properties/MobileProperties.cs | 2 +- 13 files changed, 165 insertions(+), 165 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Move/Move.cs b/OpenRA.Mods.Common/Activities/Move/Move.cs index 8c927dfa88..4cfaf7098d 100644 --- a/OpenRA.Mods.Common/Activities/Move/Move.cs +++ b/OpenRA.Mods.Common/Activities/Move/Move.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Activities getPath = () => self.World.WorldActor.Trait().FindPath( - PathSearch.FromPoint(self.World, mobile.Info, self, mobile.toCell, destination, false) + PathSearch.FromPoint(self.World, mobile.Info, self, mobile.ToCell, destination, false) .WithoutLaneBias()); this.destination = destination; this.nearEnough = WRange.Zero; @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Activities moveDisablers = self.TraitsImplementing(); getPath = () => self.World.WorldActor.Trait() - .FindUnitPath(mobile.toCell, destination, self); + .FindUnitPath(mobile.ToCell, destination, self); this.destination = destination; this.nearEnough = nearEnough; } @@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Activities moveDisablers = self.TraitsImplementing(); getPath = () => self.World.WorldActor.Trait() - .FindUnitPathToRange(mobile.fromCell, subCell, self.World.Map.CenterOfSubCell(destination, subCell), nearEnough, self); + .FindUnitPathToRange(mobile.FromCell, subCell, self.World.Map.CenterOfSubCell(destination, subCell), nearEnough, self); this.destination = destination; this.nearEnough = nearEnough; } @@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Activities getPath = () => self.World.WorldActor.Trait().FindPath( - PathSearch.FromPoint(self.World, mobile.Info, self, mobile.toCell, destination, false) + PathSearch.FromPoint(self.World, mobile.Info, self, mobile.ToCell, destination, false) .WithIgnoredActor(ignoredActor)); this.destination = destination; @@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Activities return NoPath; return self.World.WorldActor.Trait().FindUnitPathToRange( - mobile.toCell, mobile.toSubCell, target.CenterPosition, range, self); + mobile.ToCell, mobile.ToSubCell, target.CenterPosition, range, self); }; destination = null; @@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Activities List EvalPath(Actor self, Mobile mobile) { - var path = getPath().TakeWhile(a => a != mobile.toCell).ToList(); + var path = getPath().TakeWhile(a => a != mobile.ToCell).ToList(); mobile.PathHash = HashList(path); return path; } @@ -144,14 +144,14 @@ namespace OpenRA.Mods.Common.Activities if (moveDisablers.Any(d => d.MoveDisabled(self))) return this; - if (destination == mobile.toCell) + if (destination == mobile.ToCell) return NextActivity; if (path == null) { - if (mobile.ticksBeforePathing > 0) + if (mobile.TicksBeforePathing > 0) { - --mobile.ticksBeforePathing; + --mobile.TicksBeforePathing; return this; } @@ -161,7 +161,7 @@ namespace OpenRA.Mods.Common.Activities if (path.Count == 0) { - destination = mobile.toCell; + destination = mobile.ToCell; return this; } @@ -171,7 +171,7 @@ namespace OpenRA.Mods.Common.Activities if (nextCell == null) return this; - var firstFacing = self.World.Map.FacingBetween(mobile.fromCell, nextCell.Value.First, mobile.Facing); + var firstFacing = self.World.Map.FacingBetween(mobile.FromCell, nextCell.Value.First, mobile.Facing); if (firstFacing != mobile.Facing) { path.Add(nextCell.Value.First); @@ -179,11 +179,11 @@ namespace OpenRA.Mods.Common.Activities } else { - mobile.SetLocation(mobile.fromCell, mobile.fromSubCell, nextCell.Value.First, nextCell.Value.Second); + mobile.SetLocation(mobile.FromCell, mobile.FromSubCell, nextCell.Value.First, nextCell.Value.Second); var move = new MoveFirstHalf( this, - self.World.Map.CenterOfSubCell(mobile.fromCell, mobile.fromSubCell), - Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (self.World.Map.OffsetOfSubCell(mobile.fromSubCell) + self.World.Map.OffsetOfSubCell(mobile.toSubCell)) / 2, + self.World.Map.CenterOfSubCell(mobile.FromCell, mobile.FromSubCell), + Util.BetweenCells(self.World, mobile.FromCell, mobile.ToCell) + (self.World.Map.OffsetOfSubCell(mobile.FromSubCell) + self.World.Map.OffsetOfSubCell(mobile.ToSubCell)) / 2, mobile.Facing, mobile.Facing, 0); @@ -197,7 +197,7 @@ namespace OpenRA.Mods.Common.Activities { if (path.Count == 0) return; - var d = path[path.Count - 1] - mobile.toCell; + var d = path[path.Count - 1] - mobile.ToCell; if (d.LengthSquared > 2) throw new InvalidOperationException("(Move) Sanity check failed"); } @@ -224,7 +224,7 @@ namespace OpenRA.Mods.Common.Activities { // Are we close enough? var cellRange = nearEnough.Range / 1024; - if ((mobile.toCell - destination.Value).LengthSquared <= cellRange * cellRange) + if ((mobile.ToCell - destination.Value).LengthSquared <= cellRange * cellRange) { path.Clear(); return null; @@ -248,9 +248,9 @@ namespace OpenRA.Mods.Common.Activities if (--waitTicksRemaining >= 0) return null; - if (mobile.ticksBeforePathing > 0) + if (mobile.TicksBeforePathing > 0) { - --mobile.ticksBeforePathing; + --mobile.TicksBeforePathing; return null; } @@ -290,42 +290,42 @@ namespace OpenRA.Mods.Common.Activities abstract class MovePart : Activity { - protected readonly Move move; - protected readonly WPos from, to; - protected readonly int fromFacing, toFacing; - protected readonly int moveFractionTotal; + protected readonly Move Move; + protected readonly WPos From, To; + protected readonly int FromFacing, ToFacing; + protected readonly int MoveFractionTotal; protected int moveFraction; public MovePart(Move move, WPos from, WPos to, int fromFacing, int toFacing, int startingFraction) { - this.move = move; - this.from = from; - this.to = to; - this.fromFacing = fromFacing; - this.toFacing = toFacing; - this.moveFraction = startingFraction; - this.moveFractionTotal = (to - from).Length; + Move = move; + From = from; + To = to; + FromFacing = fromFacing; + ToFacing = toFacing; + moveFraction = startingFraction; + MoveFractionTotal = (to - from).Length; } public override void Cancel(Actor self) { - move.Cancel(self); + Move.Cancel(self); base.Cancel(self); } public override void Queue(Activity activity) { - move.Queue(activity); + Move.Queue(activity); } public override Activity Tick(Actor self) { var mobile = self.Trait(); - var ret = InnerTick(self, move.mobile); + var ret = InnerTick(self, Move.mobile); mobile.IsMoving = ret is MovePart; - if (moveFraction > moveFractionTotal) - moveFraction = moveFractionTotal; + if (moveFraction > MoveFractionTotal) + moveFraction = MoveFractionTotal; UpdateCenterLocation(self, mobile); return ret; @@ -333,36 +333,36 @@ namespace OpenRA.Mods.Common.Activities Activity InnerTick(Actor self, Mobile mobile) { - moveFraction += mobile.MovementSpeedForCell(self, mobile.toCell); - if (moveFraction <= moveFractionTotal) + moveFraction += mobile.MovementSpeedForCell(self, mobile.ToCell); + if (moveFraction <= MoveFractionTotal) return this; - var next = OnComplete(self, mobile, move); + var next = OnComplete(self, mobile, Move); if (next != null) return next; - return move; + return Move; } void UpdateCenterLocation(Actor self, Mobile mobile) { // avoid division through zero - if (moveFractionTotal != 0) - mobile.SetVisualPosition(self, WPos.Lerp(from, to, moveFraction, moveFractionTotal)); + if (MoveFractionTotal != 0) + mobile.SetVisualPosition(self, WPos.Lerp(From, To, moveFraction, MoveFractionTotal)); else - mobile.SetVisualPosition(self, to); + mobile.SetVisualPosition(self, To); - if (moveFraction >= moveFractionTotal) - mobile.Facing = toFacing & 0xFF; + if (moveFraction >= MoveFractionTotal) + mobile.Facing = ToFacing & 0xFF; else - mobile.Facing = int2.Lerp(fromFacing, toFacing, moveFraction, moveFractionTotal) & 0xFF; + mobile.Facing = int2.Lerp(FromFacing, ToFacing, moveFraction, MoveFractionTotal) & 0xFF; } protected abstract MovePart OnComplete(Actor self, Mobile mobile, Move parent); public override IEnumerable GetTargets(Actor self) { - return move.GetTargets(self); + return Move.GetTargets(self); } } @@ -373,14 +373,14 @@ namespace OpenRA.Mods.Common.Activities static bool IsTurn(Mobile mobile, CPos nextCell) { - return nextCell - mobile.toCell != - mobile.toCell - mobile.fromCell; + return nextCell - mobile.ToCell != + mobile.ToCell - mobile.FromCell; } protected override MovePart OnComplete(Actor self, Mobile mobile, Move parent) { - var fromSubcellOffset = self.World.Map.OffsetOfSubCell(mobile.fromSubCell); - var toSubcellOffset = self.World.Map.OffsetOfSubCell(mobile.toSubCell); + var fromSubcellOffset = self.World.Map.OffsetOfSubCell(mobile.FromSubCell); + var toSubcellOffset = self.World.Map.OffsetOfSubCell(mobile.ToSubCell); var nextCell = parent.PopPath(self, mobile); if (nextCell != null) @@ -389,15 +389,15 @@ namespace OpenRA.Mods.Common.Activities { var nextSubcellOffset = self.World.Map.OffsetOfSubCell(nextCell.Value.Second); var ret = new MoveFirstHalf( - move, - Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2, - Util.BetweenCells(self.World, mobile.toCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2, + Move, + Util.BetweenCells(self.World, mobile.FromCell, mobile.ToCell) + (fromSubcellOffset + toSubcellOffset) / 2, + Util.BetweenCells(self.World, mobile.ToCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2, mobile.Facing, - Util.GetNearestFacing(mobile.Facing, self.World.Map.FacingBetween(mobile.toCell, nextCell.Value.First, mobile.Facing)), - moveFraction - moveFractionTotal); + Util.GetNearestFacing(mobile.Facing, self.World.Map.FacingBetween(mobile.ToCell, nextCell.Value.First, mobile.Facing)), + moveFraction - MoveFractionTotal); mobile.FinishedMoving(self); - mobile.SetLocation(mobile.toCell, mobile.toSubCell, nextCell.Value.First, nextCell.Value.Second); + mobile.SetLocation(mobile.ToCell, mobile.ToSubCell, nextCell.Value.First, nextCell.Value.Second); return ret; } @@ -405,15 +405,15 @@ namespace OpenRA.Mods.Common.Activities } var ret2 = new MoveSecondHalf( - move, - Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2, - self.World.Map.CenterOfCell(mobile.toCell) + toSubcellOffset, + Move, + Util.BetweenCells(self.World, mobile.FromCell, mobile.ToCell) + (fromSubcellOffset + toSubcellOffset) / 2, + self.World.Map.CenterOfCell(mobile.ToCell) + toSubcellOffset, mobile.Facing, mobile.Facing, - moveFraction - moveFractionTotal); + moveFraction - MoveFractionTotal); mobile.EnteringCell(self); - mobile.SetLocation(mobile.toCell, mobile.toSubCell, mobile.toCell, mobile.toSubCell); + mobile.SetLocation(mobile.ToCell, mobile.ToSubCell, mobile.ToCell, mobile.ToSubCell); return ret2; } } @@ -425,7 +425,7 @@ namespace OpenRA.Mods.Common.Activities protected override MovePart OnComplete(Actor self, Mobile mobile, Move parent) { - mobile.SetPosition(self, mobile.toCell); + mobile.SetPosition(self, mobile.ToCell); return null; } } diff --git a/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs index 49c976f7de..f84ca05464 100644 --- a/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveAdjacentTo.cs @@ -26,14 +26,14 @@ namespace OpenRA.Mods.Common.Activities readonly DomainIndex domainIndex; readonly uint movementClass; - protected Target target { get; private set; } + protected Target Target { get; private set; } protected CPos targetPosition; Activity inner; bool repath; public MoveAdjacentTo(Actor self, Target target) { - this.target = target; + Target = target; mobile = self.Trait(); pathFinder = self.World.WorldActor.Trait(); @@ -58,12 +58,12 @@ namespace OpenRA.Mods.Common.Activities protected virtual IEnumerable CandidateMovementCells(Actor self) { - return Util.AdjacentCells(self.World, target); + return Util.AdjacentCells(self.World, Target); } public override Activity Tick(Actor self) { - var targetIsValid = target.IsValidFor(self); + var targetIsValid = Target.IsValidFor(self); // Inner move order has completed. if (inner == null) @@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Activities { // Check if the target has moved var oldTargetPosition = targetPosition; - targetPosition = self.World.Map.CellContaining(target.CenterPosition); + targetPosition = self.World.Map.CellContaining(Target.CenterPosition); var shouldStop = ShouldStop(self, oldTargetPosition); if (shouldStop || (!repath && ShouldRepath(self, oldTargetPosition))) @@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Activities else { // Target became invalid. Move to its last known position. - target = Target.FromCell(self.World, targetPosition); + Target = Target.FromCell(self.World, targetPosition); } // Ticks the inner move activity to actually move the actor. diff --git a/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs index e01f335063..d012208be3 100644 --- a/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs +++ b/OpenRA.Mods.Common/Activities/Move/MoveWithinRange.cs @@ -33,13 +33,13 @@ namespace OpenRA.Mods.Common.Activities // We are now in range. Don't move any further! // HACK: This works around the pathfinder not returning the shortest path var cp = self.CenterPosition; - return target.IsInRange(cp, maxRange) && !target.IsInRange(cp, minRange); + return Target.IsInRange(cp, maxRange) && !Target.IsInRange(cp, minRange); } protected override bool ShouldRepath(Actor self, CPos oldTargetPosition) { var cp = self.CenterPosition; - return targetPosition != oldTargetPosition && (!target.IsInRange(cp, maxRange) || target.IsInRange(cp, minRange)); + return targetPosition != oldTargetPosition && (!Target.IsInRange(cp, maxRange) || Target.IsInRange(cp, minRange)); } protected override IEnumerable CandidateMovementCells(Actor self) @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Activities var outerSq = maxRange.Range * maxRange.Range; var innerSq = minRange.Range * minRange.Range; - var center = target.CenterPosition; + var center = Target.CenterPosition; return map.FindTilesInAnnulus(targetPosition, minCells + 1, maxCells).Where(c => { diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index 3da3069d54..a2b5902879 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -61,9 +61,9 @@ namespace OpenRA.Mods.Common.Traits public readonly WeaponInfo Weapon; public readonly Barrel[] Barrels; - public readonly Actor self; - Lazy Turret; - Lazy Coords; + readonly Actor self; + Lazy turret; + Lazy coords; Lazy limitedAmmo; List> delayedActions = new List>(); @@ -77,8 +77,8 @@ namespace OpenRA.Mods.Common.Traits this.self = self; // We can't resolve these until runtime - Turret = Exts.Lazy(() => self.TraitsImplementing().FirstOrDefault(t => t.Name == info.Turret)); - Coords = Exts.Lazy(() => self.Trait()); + turret = Exts.Lazy(() => self.TraitsImplementing().FirstOrDefault(t => t.Name == info.Turret)); + coords = Exts.Lazy(() => self.Trait()); limitedAmmo = Exts.Lazy(() => self.TraitOrDefault()); Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()]; @@ -205,23 +205,23 @@ namespace OpenRA.Mods.Common.Traits public WVec MuzzleOffset(Actor self, Barrel b) { - var bodyOrientation = Coords.Value.QuantizeOrientation(self, self.Orientation); + var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation); var localOffset = b.Offset + new WVec(-Recoil, WRange.Zero, WRange.Zero); - if (Turret.Value != null) + if (turret.Value != null) { - var turretOrientation = Coords.Value.QuantizeOrientation(self, Turret.Value.LocalOrientation(self)); + var turretOrientation = coords.Value.QuantizeOrientation(self, turret.Value.LocalOrientation(self)); localOffset = localOffset.Rotate(turretOrientation); - localOffset += Turret.Value.Offset; + localOffset += turret.Value.Offset; } - return Coords.Value.LocalToWorld(localOffset.Rotate(bodyOrientation)); + return coords.Value.LocalToWorld(localOffset.Rotate(bodyOrientation)); } public WRot MuzzleOrientation(Actor self, Barrel b) { var orientation = self.Orientation + WRot.FromYaw(b.Yaw); - if (Turret.Value != null) - orientation += Turret.Value.LocalOrientation(self); + if (turret.Value != null) + orientation += turret.Value.LocalOrientation(self); return orientation; } diff --git a/OpenRA.Mods.Common/Traits/LimitedAmmo.cs b/OpenRA.Mods.Common/Traits/LimitedAmmo.cs index 5ebdf7b012..a398c85c8b 100644 --- a/OpenRA.Mods.Common/Traits/LimitedAmmo.cs +++ b/OpenRA.Mods.Common/Traits/LimitedAmmo.cs @@ -34,19 +34,19 @@ namespace OpenRA.Mods.Common.Traits public class LimitedAmmo : INotifyAttack, IPips, ISync { [Sync] int ammo; - LimitedAmmoInfo Info; + LimitedAmmoInfo info; public LimitedAmmo(LimitedAmmoInfo info) { ammo = info.Ammo; - Info = info; + this.info = info; } - public bool FullAmmo() { return ammo == Info.Ammo; } + public bool FullAmmo() { return ammo == info.Ammo; } public bool HasAmmo() { return ammo > 0; } public bool GiveAmmo() { - if (ammo >= Info.Ammo) return false; + if (ammo >= info.Ammo) return false; ++ammo; return true; } @@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits return true; } - public int ReloadTimePerAmmo() { return Info.ReloadTicks; } + public int ReloadTimePerAmmo() { return info.ReloadTicks; } public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { TakeAmmo(); } @@ -66,10 +66,10 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable GetPips(Actor self) { - var pips = Info.PipCount != 0 ? Info.PipCount : Info.Ammo; + var pips = info.PipCount != 0 ? info.PipCount : info.Ammo; return Enumerable.Range(0, pips).Select(i => - (ammo * pips) / Info.Ammo > i ? - Info.PipType : Info.PipTypeEmpty); + (ammo * pips) / info.Ammo > i ? + info.PipType : info.PipTypeEmpty); } } } diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 14165f4437..91e888e339 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Traits if (otherMobile == null) return false; // Sign of dot-product indicates (roughly) if vectors are facing in same or opposite directions: - var dp = CVec.Dot(selfMobile.toCell - self.Location, otherMobile.toCell - other.Location); + var dp = CVec.Dot(selfMobile.ToCell - self.Location, otherMobile.ToCell - other.Location); if (dp <= 0) return false; return true; @@ -249,60 +249,60 @@ namespace OpenRA.Mods.Common.Traits public class Mobile : IIssueOrder, IResolveOrder, IOrderVoice, IPositionable, IMove, IFacing, ISync, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyBlockingMove { - public readonly Actor self; + const int AverageTicksBeforePathing = 5; + const int SpreadTicksBeforePathing = 5; + internal int TicksBeforePathing = 0; + + readonly Actor self; public readonly MobileInfo Info; public bool IsMoving { get; set; } - int __facing; - CPos __fromCell, __toCell; - public SubCell fromSubCell, toSubCell; + int facing; + CPos fromCell, toCell; + public SubCell FromSubCell, ToSubCell; [Sync] public int Facing { - get { return __facing; } - set { __facing = value; } + get { return facing; } + set { facing = value; } } public int ROT { get { return Info.ROT; } } [Sync] public WPos CenterPosition { get; private set; } - [Sync] public CPos fromCell { get { return __fromCell; } } - [Sync] public CPos toCell { get { return __toCell; } } + [Sync] public CPos FromCell { get { return fromCell; } } + [Sync] public CPos ToCell { get { return toCell; } } [Sync] public int PathHash; // written by Move.EvalPath, to temporarily debug this crap. public void SetLocation(CPos from, SubCell fromSub, CPos to, SubCell toSub) { - if (fromCell == from && toCell == to && fromSubCell == fromSub && toSubCell == toSub) + if (FromCell == from && ToCell == to && FromSubCell == fromSub && ToSubCell == toSub) return; RemoveInfluence(); - __fromCell = from; - __toCell = to; - fromSubCell = fromSub; - toSubCell = toSub; + fromCell = from; + toCell = to; + FromSubCell = fromSub; + ToSubCell = toSub; AddInfluence(); } - const int avgTicksBeforePathing = 5; - const int spreadTicksBeforePathing = 5; - internal int ticksBeforePathing = 0; - public Mobile(ActorInitializer init, MobileInfo info) { - this.self = init.self; - this.Info = info; + self = init.self; + Info = info; - toSubCell = fromSubCell = info.SharesCell ? init.world.Map.DefaultSubCell : SubCell.FullCell; + ToSubCell = FromSubCell = info.SharesCell ? init.world.Map.DefaultSubCell : SubCell.FullCell; if (init.Contains()) { - this.fromSubCell = this.toSubCell = init.Get(); + this.FromSubCell = this.ToSubCell = init.Get(); } if (init.Contains()) { - this.__fromCell = this.__toCell = init.Get(); - SetVisualPosition(self, init.world.Map.CenterOfSubCell(fromCell, fromSubCell)); + this.fromCell = this.toCell = init.Get(); + SetVisualPosition(self, init.world.Map.CenterOfSubCell(FromCell, FromSubCell)); } this.Facing = init.Contains() ? init.Get() : info.InitialFacing; @@ -318,7 +318,7 @@ namespace OpenRA.Mods.Common.Traits { // Try same sub-cell if (preferred == SubCell.Any) - preferred = fromSubCell; + preferred = FromSubCell; // Fix sub-cell assignment if (Info.SharesCell) @@ -346,7 +346,7 @@ namespace OpenRA.Mods.Common.Traits public void SetPosition(Actor self, WPos pos) { var cell = self.World.Map.CellContaining(pos); - SetLocation(cell, fromSubCell, cell, fromSubCell); + SetLocation(cell, FromSubCell, cell, FromSubCell); SetVisualPosition(self, pos); FinishedMoving(self); } @@ -435,7 +435,7 @@ namespace OpenRA.Mods.Common.Traits if (!queued) self.CancelActivity(); - ticksBeforePathing = avgTicksBeforePathing + self.World.SharedRandom.Next(-spreadTicksBeforePathing, spreadTicksBeforePathing); + TicksBeforePathing = AverageTicksBeforePathing + self.World.SharedRandom.Next(-SpreadTicksBeforePathing, SpreadTicksBeforePathing); self.QueueActivity(new Move(self, currentLocation, 8)); @@ -481,21 +481,21 @@ namespace OpenRA.Mods.Common.Traits } } - public CPos TopLeft { get { return toCell; } } + public CPos TopLeft { get { return ToCell; } } public IEnumerable> OccupiedCells() { - if (fromCell == toCell) - return new[] { Pair.New(fromCell, fromSubCell) }; - if (CanEnterCell(toCell)) - return new[] { Pair.New(toCell, toSubCell) }; - return new[] { Pair.New(fromCell, fromSubCell), Pair.New(toCell, toSubCell) }; + if (FromCell == ToCell) + return new[] { Pair.New(FromCell, FromSubCell) }; + if (CanEnterCell(ToCell)) + return new[] { Pair.New(ToCell, ToSubCell) }; + return new[] { Pair.New(FromCell, FromSubCell), Pair.New(ToCell, ToSubCell) }; } public bool IsLeavingCell(CPos location, SubCell subCell = SubCell.Any) { - return toCell != location && __fromCell == location - && (subCell == SubCell.Any || fromSubCell == subCell || subCell == SubCell.FullCell || fromSubCell == SubCell.FullCell); + return ToCell != location && fromCell == location + && (subCell == SubCell.Any || FromSubCell == subCell || subCell == SubCell.FullCell || FromSubCell == SubCell.FullCell); } public SubCell GetAvailableSubCell(CPos a, SubCell preferredSubCell = SubCell.Any, Actor ignoreActor = null, bool checkTransientActors = true) @@ -510,7 +510,7 @@ namespace OpenRA.Mods.Common.Traits public void EnteringCell(Actor self) { - var crushables = self.World.ActorMap.GetUnitsAt(toCell).Where(a => a != self) + var crushables = self.World.ActorMap.GetUnitsAt(ToCell).Where(a => a != self) .SelectMany(a => a.TraitsImplementing().Where(b => b.CrushableBy(Info.Crushes, self.Owner))); foreach (var crushable in crushables) crushable.WarnCrush(self); @@ -518,7 +518,7 @@ namespace OpenRA.Mods.Common.Traits public void FinishedMoving(Actor self) { - var crushables = self.World.ActorMap.GetUnitsAt(toCell).Where(a => a != self) + var crushables = self.World.ActorMap.GetUnitsAt(ToCell).Where(a => a != self) .SelectMany(a => a.TraitsImplementing().Where(c => c.CrushableBy(Info.Crushes, self.Owner))); foreach (var crushable in crushables) crushable.OnCrush(self); @@ -571,11 +571,11 @@ namespace OpenRA.Mods.Common.Traits for (var i = -1; i < 2; i++) for (var j = -1; j < 2; j++) { - var p = toCell + new CVec(i, j); + var p = ToCell + new CVec(i, j); if (CanEnterCell(p)) availCells.Add(p); else - if (p != nudger.Location && p != toCell) + if (p != nudger.Location && p != ToCell) notStupidCells.Add(p); } diff --git a/OpenRA.Mods.Common/Traits/Reloads.cs b/OpenRA.Mods.Common/Traits/Reloads.cs index 5e218f46a9..93a4edb0c5 100644 --- a/OpenRA.Mods.Common/Traits/Reloads.cs +++ b/OpenRA.Mods.Common/Traits/Reloads.cs @@ -28,13 +28,13 @@ namespace OpenRA.Mods.Common.Traits public class Reloads : ITick { [Sync] int remainingTicks; - ReloadsInfo Info; + ReloadsInfo info; LimitedAmmo la; int previousAmmo; public Reloads(Actor self, ReloadsInfo info) { - Info = info; + this.info = info; remainingTicks = info.Period; la = self.Trait(); previousAmmo = la.GetAmmoCount(); @@ -44,18 +44,18 @@ namespace OpenRA.Mods.Common.Traits { if (!la.FullAmmo() && --remainingTicks == 0) { - remainingTicks = Info.Period; + remainingTicks = info.Period; - for (var i = 0; i < Info.Count; i++) + for (var i = 0; i < info.Count; i++) la.GiveAmmo(); previousAmmo = la.GetAmmoCount(); } // Resets the tick counter if ammo was fired. - if (Info.ResetOnFire && la.GetAmmoCount() < previousAmmo) + if (info.ResetOnFire && la.GetAmmoCount() < previousAmmo) { - remainingTicks = Info.Period; + remainingTicks = info.Period; previousAmmo = la.GetAmmoCount(); } } diff --git a/OpenRA.Mods.Common/Traits/World/PathFinder.cs b/OpenRA.Mods.Common/Traits/World/PathFinder.cs index 4e78f8cbc5..2391e2204d 100644 --- a/OpenRA.Mods.Common/Traits/World/PathFinder.cs +++ b/OpenRA.Mods.Common/Traits/World/PathFinder.cs @@ -28,33 +28,33 @@ namespace OpenRA.Mods.Common.Traits public class PathFinder { const int MaxPathAge = 50; /* x 40ms ticks */ - static readonly List emptyPath = new List(0); + static readonly List EmptyPath = new List(0); readonly World world; public PathFinder(World world) { this.world = world; } class CachedPath { - public CPos from; - public CPos to; - public List result; - public int tick; - public Actor actor; + public CPos From; + public CPos To; + public List Result; + public int Tick; + public Actor Actor; } - List CachedPaths = new List(); + List cachedPaths = new List(); public List FindUnitPath(CPos from, CPos target, Actor self) { using (new PerfSample("Pathfinder")) { - var cached = CachedPaths.FirstOrDefault(p => p.from == from && p.to == target && p.actor == self); + var cached = cachedPaths.FirstOrDefault(p => p.From == from && p.To == target && p.Actor == self); if (cached != null) { - Log.Write("debug", "Actor {0} asked for a path from {1} tick(s) ago", self.ActorID, world.WorldTick - cached.tick); - if (world.WorldTick - cached.tick > MaxPathAge) - CachedPaths.Remove(cached); - return new List(cached.result); + Log.Write("debug", "Actor {0} asked for a path from {1} tick(s) ago", self.ActorID, world.WorldTick - cached.Tick); + if (world.WorldTick - cached.Tick > MaxPathAge) + cachedPaths.Remove(cached); + return new List(cached.Result); } var mi = self.Info.Traits.Get(); @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits { var passable = mi.GetMovementClass(world.TileSet); if (!domainIndex.IsPassable(from, target, (uint)passable)) - return emptyPath; + return EmptyPath; } var fromPoint = PathSearch.FromPoint(world, mi, self, target, from, true) @@ -79,8 +79,8 @@ namespace OpenRA.Mods.Common.Traits CheckSanePath2(pb, from, target); - CachedPaths.RemoveAll(p => world.WorldTick - p.tick > MaxPathAge); - CachedPaths.Add(new CachedPath { from = from, to = target, actor = self, result = pb, tick = world.WorldTick }); + cachedPaths.RemoveAll(p => world.WorldTick - p.Tick > MaxPathAge); + cachedPaths.Add(new CachedPath { From = from, To = target, Actor = self, Result = pb, Tick = world.WorldTick }); return new List(pb); } } @@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits var passable = mi.GetMovementClass(world.TileSet); tilesInRange = new List(tilesInRange.Where(t => domainIndex.IsPassable(src, t, (uint)passable))); if (!tilesInRange.Any()) - return emptyPath; + return EmptyPath; } var path = FindBidiPath( @@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Traits } // no path exists - return emptyPath; + return EmptyPath; } } @@ -212,7 +212,7 @@ namespace OpenRA.Mods.Common.Traits return path; } - return emptyPath; + return EmptyPath; } } diff --git a/OpenRA.Mods.Common/Traits/World/PathSearch.cs b/OpenRA.Mods.Common/Traits/World/PathSearch.cs index 323bbf0581..c4bce59a40 100644 --- a/OpenRA.Mods.Common/Traits/World/PathSearch.cs +++ b/OpenRA.Mods.Common/Traits/World/PathSearch.cs @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits // For horizontal/vertical directions, the set is the three cells 'ahead'. For diagonal directions, the set // is the three cells ahead, plus the two cells to the side, which we cannot exclude without knowing if // the cell directly between them and our parent is passable. - static CVec[][] DirectedNeighbors = { + static CVec[][] directedNeighbors = { new CVec[] { new CVec(-1, -1), new CVec(0, -1), new CVec(1, -1), new CVec(-1, 0), new CVec(-1, 1) }, new CVec[] { new CVec(-1, -1), new CVec(0, -1), new CVec(1, -1) }, new CVec[] { new CVec(-1, -1), new CVec(0, -1), new CVec(1, -1), new CVec(1, 0), new CVec(1, 1) }, @@ -161,7 +161,7 @@ namespace OpenRA.Mods.Common.Traits var dy = p.Y - prev.Y; var index = dy * 3 + dx + 4; - return DirectedNeighbors[index]; + return directedNeighbors[index]; } public CPos Expand(World world) @@ -285,7 +285,7 @@ namespace OpenRA.Mods.Common.Traits } static readonly Queue> CellInfoPool = new Queue>(); - static readonly object defaultCellInfoLayerSync = new object(); + static readonly object DefaultCellInfoLayerSync = new object(); static CellLayer defaultCellInfoLayer; static CellLayer GetFromPool() @@ -325,7 +325,7 @@ namespace OpenRA.Mods.Common.Traits if (result == null) result = new CellLayer(map); - lock (defaultCellInfoLayerSync) + lock (DefaultCellInfoLayerSync) { if (defaultCellInfoLayer == null || defaultCellInfoLayer.Size != mapSize || diff --git a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs index fa52ff69d7..d095978a41 100644 --- a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs +++ b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs @@ -8,8 +8,8 @@ */ #endregion -using OpenRA.Mods.D2k.Activities; using OpenRA.Mods.Common.Traits; +using OpenRA.Mods.D2k.Activities; using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits diff --git a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs index 44672f633f..c77a412f23 100644 --- a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs @@ -39,9 +39,9 @@ namespace OpenRA.Mods.RA.Activities } var mobile = self.Trait(); - var nearest = target.Actor.OccupiesSpace.NearestCellTo(mobile.toCell); + var nearest = target.Actor.OccupiesSpace.NearestCellTo(mobile.ToCell); - if ((nearest - mobile.toCell).LengthSquared > 2) + if ((nearest - mobile.ToCell).LengthSquared > 2) return Util.SequenceActivities(new MoveAdjacentTo(self, target), this); if (!capturable.CaptureInProgress) diff --git a/OpenRA.Mods.RA/Activities/Leap.cs b/OpenRA.Mods.RA/Activities/Leap.cs index 0e46f43954..fa497a43c5 100644 --- a/OpenRA.Mods.RA/Activities/Leap.cs +++ b/OpenRA.Mods.RA/Activities/Leap.cs @@ -38,11 +38,11 @@ namespace OpenRA.Mods.RA.Activities this.weapon = weapon; this.angle = angle; mobile = self.Trait(); - mobile.SetLocation(mobile.fromCell, mobile.fromSubCell, targetMobile.fromCell, targetMobile.fromSubCell); + mobile.SetLocation(mobile.FromCell, mobile.FromSubCell, targetMobile.FromCell, targetMobile.FromSubCell); mobile.IsMoving = true; from = self.CenterPosition; - to = self.World.Map.CenterOfSubCell(targetMobile.fromCell, targetMobile.fromSubCell); + to = self.World.Map.CenterOfSubCell(targetMobile.FromCell, targetMobile.FromSubCell); length = Math.Max((to - from).Length / speed.Range, 1); self.Trait().Attacking(self, Target.FromActor(target)); @@ -59,11 +59,11 @@ namespace OpenRA.Mods.RA.Activities mobile.SetVisualPosition(self, WPos.LerpQuadratic(from, to, angle, ++ticks, length)); if (ticks >= length) { - mobile.SetLocation(mobile.toCell, mobile.toSubCell, mobile.toCell, mobile.toSubCell); + mobile.SetLocation(mobile.ToCell, mobile.ToSubCell, mobile.ToCell, mobile.ToSubCell); mobile.FinishedMoving(self); mobile.IsMoving = false; - self.World.ActorMap.GetUnitsAt(mobile.toCell, mobile.toSubCell) + self.World.ActorMap.GetUnitsAt(mobile.ToCell, mobile.ToSubCell) .Except(new[] { self }).Where(t => weapon.IsValidAgainst(t, self)) .Do(t => t.Kill(self)); diff --git a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs index 473e15d2c8..d3b4f07957 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Moves from outside the world into the cell grid")] public void MoveIntoWorld(CPos cell) { - self.QueueActivity(mobile.MoveIntoWorld(self, cell, mobile.toSubCell)); + self.QueueActivity(mobile.MoveIntoWorld(self, cell, mobile.ToSubCell)); } [ScriptActorPropertyActivity]