more wiring for selling

This commit is contained in:
Chris Forbes
2010-01-02 12:40:09 +13:00
parent 97fdedac4f
commit 27e47cd066
3 changed files with 18 additions and 1 deletions

View File

@@ -182,6 +182,7 @@ namespace OpenRa.Game
case "Capture": return Cursor.Capture;
case "Harvest": return Cursor.Attack; // TODO: special harvest cursor?
case "PlaceBuilding": return Cursor.Default;
case "Sell": return Cursor.Sell;
default:
return null;
}

View File

@@ -26,5 +26,6 @@ namespace OpenRa.Game
public static Cursor C4 { get { return new Cursor("c4"); } }
public static Cursor Capture { get { return new Cursor("capture"); } }
public static Cursor Heal { get { return new Cursor("heal"); } }
public static Cursor Sell { get { return new Cursor("sell"); } }
}
}

View File

@@ -1,8 +1,9 @@
using OpenRa.Game.GameRules;
using OpenRa.Game.Traits.Activities;
namespace OpenRa.Game.Traits
{
class Building : INotifyDamage
class Building : INotifyDamage, IOrder
{
public readonly BuildingInfo unitInfo;
@@ -18,5 +19,19 @@ namespace OpenRa.Game.Traits
if (e.DamageState == DamageState.Dead)
Sound.Play("kaboom22.aud");
}
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
return null; // sell/repair orders are issued through Chrome, not here.
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "Sell")
{
self.CancelActivity();
self.QueueActivity(new Sell());
}
}
}
}