shuffling

This commit is contained in:
Chris Forbes
2010-01-02 12:22:34 +13:00
parent acacd99a71
commit a2a00ae599
17 changed files with 34 additions and 36 deletions

View File

@@ -2,13 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms;
using IjwFramework.Collections;
using IjwFramework.Types; using IjwFramework.Types;
using OpenRa.Game.Graphics;
using OpenRa.Game.Support;
using OpenRa.Game.GameRules; using OpenRa.Game.GameRules;
using OpenRa.Game.Graphics;
using OpenRa.Game.Orders;
using OpenRa.Game.Support;
namespace OpenRa.Game namespace OpenRa.Game
{ {
@@ -363,7 +361,7 @@ namespace OpenRa.Game
if (producing.Done) if (producing.Done)
{ {
if (group == "Building" || group == "Defense") if (group == "Building" || group == "Defense")
Game.controller.orderGenerator = new PlaceBuilding(player.PlayerActor, item); Game.controller.orderGenerator = new PlaceBuildingOrderGenerator(player.PlayerActor, item);
return; return;
} }

View File

@@ -5,6 +5,7 @@ using IjwFramework.Collections;
using IjwFramework.Types; using IjwFramework.Types;
using OpenRa.Game.GameRules; using OpenRa.Game.GameRules;
using OpenRa.Game.Graphics; using OpenRa.Game.Graphics;
using OpenRa.Game.Orders;
using OpenRa.Game.Traits; using OpenRa.Game.Traits;
namespace OpenRa.Game namespace OpenRa.Game
@@ -62,7 +63,7 @@ namespace OpenRa.Game
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down) if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down)
{ {
if (!(orderGenerator is PlaceBuilding)) if (!(orderGenerator is PlaceBuildingOrderGenerator))
dragStart = dragEnd = xy; dragStart = dragEnd = xy;
ApplyOrders(xy, mi); ApplyOrders(xy, mi);
} }
@@ -72,7 +73,7 @@ namespace OpenRa.Game
if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up) 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); var newSelection = Game.SelectActorsInBox(Game.CellSize * dragStart, Game.CellSize * xy);
CombineSelection(newSelection, mi.Modifiers.HasModifier(Modifiers.Shift), dragStart == xy); CombineSelection(newSelection, mi.Modifiers.HasModifier(Modifiers.Shift), dragStart == xy);

View File

@@ -6,6 +6,7 @@ using System.Net.Sockets;
using OpenRa.FileFormats; using OpenRa.FileFormats;
using OpenRa.Game.GameRules; using OpenRa.Game.GameRules;
using OpenRa.Game.Graphics; using OpenRa.Game.Graphics;
using OpenRa.Game.Orders;
using OpenRa.Game.Support; using OpenRa.Game.Support;
using OpenRa.Game.Traits; using OpenRa.Game.Traits;

View File

@@ -93,16 +93,16 @@
<Compile Include="GameRules\TechTree.cs" /> <Compile Include="GameRules\TechTree.cs" />
<Compile Include="GameRules\VoiceInfo.cs" /> <Compile Include="GameRules\VoiceInfo.cs" />
<Compile Include="Effects\IEffect.cs" /> <Compile Include="Effects\IEffect.cs" />
<Compile Include="IOrderSource.cs" /> <Compile Include="Orders\IOrderSource.cs" />
<Compile Include="LocalOrderSource.cs" /> <Compile Include="Orders\LocalOrderSource.cs" />
<Compile Include="Effects\Missile.cs" /> <Compile Include="Effects\Missile.cs" />
<Compile Include="NetworkOrderSource.cs" /> <Compile Include="Orders\NetworkOrderSource.cs" />
<Compile Include="OrderIO.cs" /> <Compile Include="Orders\OrderIO.cs" />
<Compile Include="OrderManager.cs" /> <Compile Include="Orders\OrderManager.cs" />
<Compile Include="Ore.cs" /> <Compile Include="Ore.cs" />
<Compile Include="PathSearch.cs" /> <Compile Include="PathSearch.cs" />
<Compile Include="ProductionItem.cs" /> <Compile Include="ProductionItem.cs" />
<Compile Include="ReplayOrderSource.cs" /> <Compile Include="Orders\ReplayOrderSource.cs" />
<Compile Include="Smudge.cs" /> <Compile Include="Smudge.cs" />
<Compile Include="Sound.cs" /> <Compile Include="Sound.cs" />
<Compile Include="Support\Stopwatch.cs" /> <Compile Include="Support\Stopwatch.cs" />
@@ -149,15 +149,15 @@
<Compile Include="Traits\Activities\Sell.cs" /> <Compile Include="Traits\Activities\Sell.cs" />
<Compile Include="Traits\Activities\Teleport.cs" /> <Compile Include="Traits\Activities\Teleport.cs" />
<Compile Include="BuildingInfluenceMap.cs" /> <Compile Include="BuildingInfluenceMap.cs" />
<Compile Include="IOrderGenerator.cs" /> <Compile Include="Orders\IOrderGenerator.cs" />
<Compile Include="PlaceBuilding.cs" /> <Compile Include="Orders\PlaceBuildingOrderGenerator.cs" />
<Compile Include="Player.cs" /> <Compile Include="Player.cs" />
<Compile Include="Race.cs" /> <Compile Include="Race.cs" />
<Compile Include="Graphics\Sheet.cs" /> <Compile Include="Graphics\Sheet.cs" />
<Compile Include="Support\Log.cs" /> <Compile Include="Support\Log.cs" />
<Compile Include="PathFinder.cs" /> <Compile Include="PathFinder.cs" />
<Compile Include="Graphics\Sequence.cs" /> <Compile Include="Graphics\Sequence.cs" />
<Compile Include="Order.cs" /> <Compile Include="Orders\Order.cs" />
<Compile Include="Graphics\SequenceProvider.cs" /> <Compile Include="Graphics\SequenceProvider.cs" />
<Compile Include="Graphics\SheetBuilder.cs" /> <Compile Include="Graphics\SheetBuilder.cs" />
<Compile Include="Graphics\HardwarePalette.cs" /> <Compile Include="Graphics\HardwarePalette.cs" />
@@ -234,14 +234,14 @@
<Compile Include="Traits\Unit.cs" /> <Compile Include="Traits\Unit.cs" />
<Compile Include="Traits\WaterPaletteRotation.cs" /> <Compile Include="Traits\WaterPaletteRotation.cs" />
<Compile Include="Traits\WithShadow.cs" /> <Compile Include="Traits\WithShadow.cs" />
<Compile Include="UnitOrders.cs" /> <Compile Include="Orders\UnitOrders.cs" />
<Compile Include="Traits\Util.cs" /> <Compile Include="Traits\Util.cs" />
<Compile Include="UiOverlay.cs" /> <Compile Include="UiOverlay.cs" />
<Compile Include="Graphics\Util.cs" /> <Compile Include="Graphics\Util.cs" />
<Compile Include="Graphics\Vertex.cs" /> <Compile Include="Graphics\Vertex.cs" />
<Compile Include="Graphics\Viewport.cs" /> <Compile Include="Graphics\Viewport.cs" />
<Compile Include="UnitInfluenceMap.cs" /> <Compile Include="UnitInfluenceMap.cs" />
<Compile Include="UnitOrderGenerator.cs" /> <Compile Include="Orders\UnitOrderGenerator.cs" />
<Compile Include="VoicePool.cs" /> <Compile Include="VoicePool.cs" />
<Compile Include="World.cs" /> <Compile Include="World.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
interface IOrderSource interface IOrderSource
{ {

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class LocalOrderSource : IOrderSource class LocalOrderSource : IOrderSource
{ {

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class NetworkOrderSource : IOrderSource class NetworkOrderSource : IOrderSource
{ {

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
static class OrderIO static class OrderIO
{ {

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class OrderManager class OrderManager
{ {

View File

@@ -1,14 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using OpenRa.Game.GameRules; using OpenRa.Game.GameRules;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class PlaceBuilding : IOrderGenerator class PlaceBuildingOrderGenerator : IOrderGenerator
{ {
readonly Actor Producer; readonly Actor Producer;
readonly BuildingInfo Building; readonly BuildingInfo Building;
public PlaceBuilding(Actor producer, string name) public PlaceBuildingOrderGenerator(Actor producer, string name)
{ {
Producer = producer; Producer = producer;
Building = (BuildingInfo)Rules.UnitInfo[ name ]; Building = (BuildingInfo)Rules.UnitInfo[ name ];

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class ReplayOrderSource : IOrderSource class ReplayOrderSource : IOrderSource
{ {

View File

@@ -2,7 +2,7 @@
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
class UnitOrderGenerator : IOrderGenerator class UnitOrderGenerator : IOrderGenerator
{ {

View File

@@ -1,11 +1,9 @@
using System; using System.Drawing;
using System.Drawing;
using System.Linq;
using OpenRa.Game.GameRules; using OpenRa.Game.GameRules;
using OpenRa.Game.Traits;
using OpenRa.Game.Graphics; using OpenRa.Game.Graphics;
using OpenRa.Game.Traits;
namespace OpenRa.Game namespace OpenRa.Game.Orders
{ {
static class UnitOrders static class UnitOrders
{ {

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using OpenRa.Game.Graphics; using OpenRa.Game.Graphics;
using OpenRa.Game.Orders;
namespace OpenRa.Game.Traits namespace OpenRa.Game.Traits
{ {

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic; using OpenRa.Game.Graphics;
using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits namespace OpenRa.Game.Traits
{ {