From a2a00ae5990e496dd91a028abce25ce9de970bbd Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 2 Jan 2010 12:22:34 +1300 Subject: [PATCH] shuffling --- OpenRa.Game/Chrome.cs | 10 ++++----- OpenRa.Game/Controller.cs | 5 +++-- OpenRa.Game/Game.cs | 1 + OpenRa.Game/OpenRa.Game.csproj | 22 +++++++++---------- OpenRa.Game/{ => Orders}/IOrderGenerator.cs | 0 OpenRa.Game/{ => Orders}/IOrderSource.cs | 2 +- OpenRa.Game/{ => Orders}/LocalOrderSource.cs | 2 +- .../{ => Orders}/NetworkOrderSource.cs | 2 +- OpenRa.Game/{ => Orders}/Order.cs | 0 OpenRa.Game/{ => Orders}/OrderIO.cs | 2 +- OpenRa.Game/{ => Orders}/OrderManager.cs | 2 +- .../PlaceBuildingOrderGenerator.cs} | 6 ++--- OpenRa.Game/{ => Orders}/ReplayOrderSource.cs | 2 +- .../{ => Orders}/UnitOrderGenerator.cs | 2 +- OpenRa.Game/{ => Orders}/UnitOrders.cs | 8 +++---- OpenRa.Game/Traits/RallyPoint.cs | 1 + OpenRa.Game/Traits/RenderUnitRotor.cs | 3 +-- 17 files changed, 34 insertions(+), 36 deletions(-) rename OpenRa.Game/{ => Orders}/IOrderGenerator.cs (100%) rename OpenRa.Game/{ => Orders}/IOrderSource.cs (84%) rename OpenRa.Game/{ => Orders}/LocalOrderSource.cs (91%) rename OpenRa.Game/{ => Orders}/NetworkOrderSource.cs (94%) rename OpenRa.Game/{ => Orders}/Order.cs (100%) rename OpenRa.Game/{ => Orders}/OrderIO.cs (92%) rename OpenRa.Game/{ => Orders}/OrderManager.cs (94%) mode change 100755 => 100644 rename OpenRa.Game/{PlaceBuilding.cs => Orders/PlaceBuildingOrderGenerator.cs} (87%) rename OpenRa.Game/{ => Orders}/ReplayOrderSource.cs (92%) rename OpenRa.Game/{ => Orders}/UnitOrderGenerator.cs (91%) mode change 100755 => 100644 rename OpenRa.Game/{ => Orders}/UnitOrders.cs (93%) mode change 100755 => 100644 diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index a8dac419e0..47a395e019 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -2,13 +2,11 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -using System.Windows.Forms; -using IjwFramework.Collections; using IjwFramework.Types; -using OpenRa.Game.Graphics; -using OpenRa.Game.Support; using OpenRa.Game.GameRules; - +using OpenRa.Game.Graphics; +using OpenRa.Game.Orders; +using OpenRa.Game.Support; namespace OpenRa.Game { @@ -363,7 +361,7 @@ namespace OpenRa.Game if (producing.Done) { if (group == "Building" || group == "Defense") - Game.controller.orderGenerator = new PlaceBuilding(player.PlayerActor, item); + Game.controller.orderGenerator = new PlaceBuildingOrderGenerator(player.PlayerActor, item); return; } diff --git a/OpenRa.Game/Controller.cs b/OpenRa.Game/Controller.cs index 1ea516427e..875a0950b7 100644 --- a/OpenRa.Game/Controller.cs +++ b/OpenRa.Game/Controller.cs @@ -5,6 +5,7 @@ using IjwFramework.Collections; using IjwFramework.Types; using OpenRa.Game.GameRules; using OpenRa.Game.Graphics; +using OpenRa.Game.Orders; using OpenRa.Game.Traits; namespace OpenRa.Game @@ -62,7 +63,7 @@ namespace OpenRa.Game if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down) { - if (!(orderGenerator is PlaceBuilding)) + if (!(orderGenerator is PlaceBuildingOrderGenerator)) dragStart = dragEnd = xy; ApplyOrders(xy, mi); } @@ -72,7 +73,7 @@ namespace OpenRa.Game if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up) { - if (!(orderGenerator is PlaceBuilding)) + if (!(orderGenerator is PlaceBuildingOrderGenerator)) { var newSelection = Game.SelectActorsInBox(Game.CellSize * dragStart, Game.CellSize * xy); CombineSelection(newSelection, mi.Modifiers.HasModifier(Modifiers.Shift), dragStart == xy); diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 7be0cad8fd..e3a6cb490c 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -6,6 +6,7 @@ using System.Net.Sockets; using OpenRa.FileFormats; using OpenRa.Game.GameRules; using OpenRa.Game.Graphics; +using OpenRa.Game.Orders; using OpenRa.Game.Support; using OpenRa.Game.Traits; diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index 185d03cc18..25a2d9b677 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -93,16 +93,16 @@ - - + + - - - + + + - + @@ -149,15 +149,15 @@ - - + + - + @@ -234,14 +234,14 @@ - + - + diff --git a/OpenRa.Game/IOrderGenerator.cs b/OpenRa.Game/Orders/IOrderGenerator.cs similarity index 100% rename from OpenRa.Game/IOrderGenerator.cs rename to OpenRa.Game/Orders/IOrderGenerator.cs diff --git a/OpenRa.Game/IOrderSource.cs b/OpenRa.Game/Orders/IOrderSource.cs similarity index 84% rename from OpenRa.Game/IOrderSource.cs rename to OpenRa.Game/Orders/IOrderSource.cs index 6fe8653969..2abd7fda74 100644 --- a/OpenRa.Game/IOrderSource.cs +++ b/OpenRa.Game/Orders/IOrderSource.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { interface IOrderSource { diff --git a/OpenRa.Game/LocalOrderSource.cs b/OpenRa.Game/Orders/LocalOrderSource.cs similarity index 91% rename from OpenRa.Game/LocalOrderSource.cs rename to OpenRa.Game/Orders/LocalOrderSource.cs index 2bee88f8cc..6dcb2b88e8 100644 --- a/OpenRa.Game/LocalOrderSource.cs +++ b/OpenRa.Game/Orders/LocalOrderSource.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { class LocalOrderSource : IOrderSource { diff --git a/OpenRa.Game/NetworkOrderSource.cs b/OpenRa.Game/Orders/NetworkOrderSource.cs similarity index 94% rename from OpenRa.Game/NetworkOrderSource.cs rename to OpenRa.Game/Orders/NetworkOrderSource.cs index 84fa81fc3a..6f279dfa6d 100644 --- a/OpenRa.Game/NetworkOrderSource.cs +++ b/OpenRa.Game/Orders/NetworkOrderSource.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Net.Sockets; using System.Threading; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { class NetworkOrderSource : IOrderSource { diff --git a/OpenRa.Game/Order.cs b/OpenRa.Game/Orders/Order.cs similarity index 100% rename from OpenRa.Game/Order.cs rename to OpenRa.Game/Orders/Order.cs diff --git a/OpenRa.Game/OrderIO.cs b/OpenRa.Game/Orders/OrderIO.cs similarity index 92% rename from OpenRa.Game/OrderIO.cs rename to OpenRa.Game/Orders/OrderIO.cs index dafc95aa31..c2940ddcf7 100644 --- a/OpenRa.Game/OrderIO.cs +++ b/OpenRa.Game/Orders/OrderIO.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.IO; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { static class OrderIO { diff --git a/OpenRa.Game/OrderManager.cs b/OpenRa.Game/Orders/OrderManager.cs old mode 100755 new mode 100644 similarity index 94% rename from OpenRa.Game/OrderManager.cs rename to OpenRa.Game/Orders/OrderManager.cs index 383fb98071..ee0b14a9c9 --- a/OpenRa.Game/OrderManager.cs +++ b/OpenRa.Game/Orders/OrderManager.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { class OrderManager { diff --git a/OpenRa.Game/PlaceBuilding.cs b/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs similarity index 87% rename from OpenRa.Game/PlaceBuilding.cs rename to OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs index 3dbb3940d3..6408529c89 100644 --- a/OpenRa.Game/PlaceBuilding.cs +++ b/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs @@ -1,14 +1,14 @@ using System.Collections.Generic; using OpenRa.Game.GameRules; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { - class PlaceBuilding : IOrderGenerator + class PlaceBuildingOrderGenerator : IOrderGenerator { readonly Actor Producer; readonly BuildingInfo Building; - public PlaceBuilding(Actor producer, string name) + public PlaceBuildingOrderGenerator(Actor producer, string name) { Producer = producer; Building = (BuildingInfo)Rules.UnitInfo[ name ]; diff --git a/OpenRa.Game/ReplayOrderSource.cs b/OpenRa.Game/Orders/ReplayOrderSource.cs similarity index 92% rename from OpenRa.Game/ReplayOrderSource.cs rename to OpenRa.Game/Orders/ReplayOrderSource.cs index 02485bbd9f..97d62cf8c6 100644 --- a/OpenRa.Game/ReplayOrderSource.cs +++ b/OpenRa.Game/Orders/ReplayOrderSource.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.IO; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { class ReplayOrderSource : IOrderSource { diff --git a/OpenRa.Game/UnitOrderGenerator.cs b/OpenRa.Game/Orders/UnitOrderGenerator.cs old mode 100755 new mode 100644 similarity index 91% rename from OpenRa.Game/UnitOrderGenerator.cs rename to OpenRa.Game/Orders/UnitOrderGenerator.cs index 8885899db3..91515eec3a --- a/OpenRa.Game/UnitOrderGenerator.cs +++ b/OpenRa.Game/Orders/UnitOrderGenerator.cs @@ -2,7 +2,7 @@ using System.Drawing; using System.Linq; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { class UnitOrderGenerator : IOrderGenerator { diff --git a/OpenRa.Game/UnitOrders.cs b/OpenRa.Game/Orders/UnitOrders.cs old mode 100755 new mode 100644 similarity index 93% rename from OpenRa.Game/UnitOrders.cs rename to OpenRa.Game/Orders/UnitOrders.cs index ec670e62a9..4a03e43ea0 --- a/OpenRa.Game/UnitOrders.cs +++ b/OpenRa.Game/Orders/UnitOrders.cs @@ -1,11 +1,9 @@ -using System; -using System.Drawing; -using System.Linq; +using System.Drawing; using OpenRa.Game.GameRules; -using OpenRa.Game.Traits; using OpenRa.Game.Graphics; +using OpenRa.Game.Traits; -namespace OpenRa.Game +namespace OpenRa.Game.Orders { static class UnitOrders { diff --git a/OpenRa.Game/Traits/RallyPoint.cs b/OpenRa.Game/Traits/RallyPoint.cs index acb2b8b63a..21edb5e0f1 100644 --- a/OpenRa.Game/Traits/RallyPoint.cs +++ b/OpenRa.Game/Traits/RallyPoint.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using OpenRa.Game.Graphics; +using OpenRa.Game.Orders; namespace OpenRa.Game.Traits { diff --git a/OpenRa.Game/Traits/RenderUnitRotor.cs b/OpenRa.Game/Traits/RenderUnitRotor.cs index 322345bc71..b2174a97c4 100755 --- a/OpenRa.Game/Traits/RenderUnitRotor.cs +++ b/OpenRa.Game/Traits/RenderUnitRotor.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using OpenRa.Game.Graphics; +using OpenRa.Game.Graphics; namespace OpenRa.Game.Traits {