merged. may not actually work yet.

This commit is contained in:
Chris Forbes
2010-01-09 11:34:44 +13:00
10 changed files with 66 additions and 65 deletions

View File

@@ -1,19 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using OpenRa.Game.Traits;
using OpenRa.Game.SupportPowers;
namespace OpenRa.Game.Orders
{
class ChronoshiftDestinationOrderGenerator : IOrderGenerator
{
public readonly Actor self;
SupportPower power;
public ChronoshiftDestinationOrderGenerator(Actor self)
public ChronoshiftDestinationOrderGenerator(Actor self, SupportPower power)
{
this.self = self;
this.power = power;
}
public IEnumerable<Order> Order(int2 xy, MouseInput mi)
@@ -23,8 +25,8 @@ namespace OpenRa.Game.Orders
Game.controller.CancelInputMode();
yield break;
}
yield return new Order("Chronoshift", self, null, xy, null);
yield return new Order("Chronoshift", self, null, xy,
power != null ? power.Name : null);
}
public void Tick() {}

View File

@@ -1,14 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.GameRules;
using OpenRa.Game.Traits;
using OpenRa.Game.SupportPowers;
namespace OpenRa.Game.Orders
{
class ChronosphereSelectOrderGenerator : IOrderGenerator
{
ISupportPowerImpl chronospherePower;
public ChronosphereSelectOrderGenerator(ISupportPowerImpl chronospherePower)
{
this.chronospherePower = chronospherePower;
}
public IEnumerable<Order> Order(int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
@@ -30,9 +36,7 @@ namespace OpenRa.Game.Orders
var unit = underCursor != null ? underCursor.Info as UnitInfo : null;
if (unit != null)
{
yield return new Order("ChronosphereSelect", underCursor, null, int2.Zero, null);
}
yield return new Order("ChronosphereSelect", underCursor, null, int2.Zero, "ChronoshiftPower");
}
}

View File

@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.GameRules;
using OpenRa.Game.Traits;
using OpenRa.Game.SupportPowers;
namespace OpenRa.Game.Orders
{
class IronCurtainOrderGenerator : IOrderGenerator

View File

@@ -13,7 +13,7 @@ namespace OpenRa.Game
public readonly int2 TargetLocation;
public readonly string TargetString;
public bool IsImmediate;
public Actor Subject { get { return ActorFromUInt(SubjectId); } }
public Actor TargetActor { get { return ActorFromUInt(TargetActorId); } }
public Player Player { get { return Subject.Owner; } }
@@ -21,8 +21,8 @@ namespace OpenRa.Game
public Order(string orderString, Actor subject,
Actor targetActor, int2 targetLocation, string targetString)
: this( orderString, UIntFromActor( subject ),
UIntFromActor( targetActor ), targetLocation, targetString ) {}
UIntFromActor( targetActor ), targetLocation, targetString) {}
Order(string orderString, uint subjectId,
uint targetActorId, int2 targetLocation, string targetString)
{
@@ -30,7 +30,7 @@ namespace OpenRa.Game
this.SubjectId = subjectId;
this.TargetActorId = targetActorId;
this.TargetLocation = targetLocation;
this.TargetString = targetString;
this.TargetString = targetString;
}
public bool Validate()