hacked in selling to F3

This commit is contained in:
Chris Forbes
2010-01-02 12:50:45 +13:00
parent 0737335663
commit 43a8604ce9
5 changed files with 14 additions and 8 deletions

View File

@@ -18,7 +18,11 @@ namespace OpenRa.Game.Traits.Activities
self.Owner.GiveCash((int)refund);
self.Health = 0;
foreach (var ns in self.traits.WithInterface<INotifySold>())
ns.Sold(self);
Game.world.Remove(self);
// todo: give dudes
}
public IActivity Tick(Actor self)

View File

@@ -5,7 +5,7 @@ using OpenRa.Game.Effects;
namespace OpenRa.Game.Traits
{
class RenderBuilding : RenderSimple, INotifyDamage
class RenderBuilding : RenderSimple, INotifyDamage, INotifySold
{
const int SmallBibStart = 1;
const int LargeBibStart = 5;
@@ -88,5 +88,7 @@ namespace OpenRa.Game.Traits
break;
}
}
public void Sold(Actor self) { DoBib(self, true); }
}
}

View File

@@ -13,6 +13,7 @@ namespace OpenRa.Game.Traits
interface ITick { void Tick(Actor self); }
interface IRender { IEnumerable<Renderable> Render(Actor self); }
interface INotifySold { void Sold(Actor self); }
interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
interface INotifyBuildComplete { void BuildingComplete (Actor self); }
interface INotifyProduction { void UnitProduced(Actor self, Actor other); }