new support power impl

This commit is contained in:
Chris Forbes
2010-01-23 21:07:27 +13:00
parent bbf94fef79
commit d7a2691db3
56 changed files with 409 additions and 489 deletions

View File

@@ -3,17 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using OpenRa.GameRules;
using OpenRa.Traits;
using OpenRa.SupportPowers;
namespace OpenRa.Orders
{
class ChronosphereSelectOrderGenerator : IOrderGenerator
{
SupportPower power;
public ChronosphereSelectOrderGenerator(SupportPower power)
{
this.power = power;
}
public ChronosphereSelectOrderGenerator() {}
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
@@ -32,10 +27,12 @@ namespace OpenRa.Orders
.Where(a => a.Owner == world.LocalPlayer
&& a.traits.Contains<Chronoshiftable>()
&& a.traits.Contains<Selectable>()).FirstOrDefault();
if (underCursor != null)
yield return new Order("ChronosphereSelect", underCursor, null, int2.Zero, power.Name);
yield return new Order("ChronosphereSelect", world.LocalPlayer.PlayerActor, underCursor);
}
yield break;
}
public void Tick( World world )
@@ -43,8 +40,9 @@ namespace OpenRa.Orders
var hasChronosphere = world.Actors
.Any(a => a.Owner == world.LocalPlayer && a.traits.Contains<Chronosphere>());
if (!hasChronosphere)
Game.controller.CancelInputMode();
// HACK: re-enable this
//if (!hasChronosphere)
// Game.controller.CancelInputMode();
}
public void Render( World world ) { }