Per-player unit production. Also, fixed an interesting bug in Sequence.

This commit is contained in:
Bob
2009-10-30 04:03:37 +13:00
parent 8580ae0f78
commit 242fa717b6
6 changed files with 551 additions and 481 deletions

View File

@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IjwFramework.Types;
using System.Drawing;
using OpenRa.Game.Traits;
namespace OpenRa.Game
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IjwFramework.Types;
using System.Drawing;
using OpenRa.Game.Traits;
namespace OpenRa.Game
{
class Controller
{
@@ -76,7 +76,7 @@ namespace OpenRa.Game
if (mi.Button == MouseButtons.None && mi.Event == MouseInputEvent.Move)
{
/* update the cursor to reflect the thing under us - note this
/* update the cursor to reflect the thing under us - note this
* needs to also happen when the *thing* changes, so per-frame hook */
dragStart = dragEnd = xy;
}
@@ -101,31 +101,6 @@ namespace OpenRa.Game
.FirstOrDefault(a => a != null) : null;
return c ?? (Game.SelectUnitOrBuilding(Game.CellSize * dragEnd).Any() ? Cursor.Select : Cursor.Default);
//foreach( var o in
//var uog = orderGenerator as UnitOrderGenerator;
//if (uog != null)
// uog.selection.RemoveAll(a => a.IsDead);
//if (uog != null && uog.selection.Count > 0
// && uog.selection.Any(a => a.traits.Contains<Traits.Mobile>())
// && uog.selection.All(a => a.Owner == Game.LocalPlayer))
//{
// var umts = uog.selection.Select(a => a.traits.GetOrDefault<Mobile>())
// .Where(m => m != null)
// .Select(m => m.GetMovementType())
// .Distinct();
// if (!umts.Any(umt => Game.IsCellBuildable(dragEnd.ToInt2(), umt)))
// return Cursor.MoveBlocked;
// return Cursor.Move;
//}
//if (Game.SelectUnitOrBuilding(Game.CellSize * dragEnd).Any())
// return Cursor.Select;
//return Cursor.Default;
}
}
}
}
}