Start thinking about how the harv<->proc interaction is going to work

This commit is contained in:
Paul Chote
2010-02-01 00:58:57 +13:00
parent 4fcb655e2c
commit 249c56d82f
9 changed files with 56 additions and 11 deletions

View File

@@ -0,0 +1,32 @@
using OpenRa.Traits.Activities;
namespace OpenRa.Traits
{
class TiberiumRefineryInfo : ITraitInfo
{
public object Create(Actor self) { return new TiberiumRefinery(self); }
}
class TiberiumRefinery : IAcceptOre
{
Actor self;
public TiberiumRefinery(Actor self)
{
this.self = self;
self.World.AddFrameEndTask(
w =>
{ /* create the free harvester! */
var harvester = w.CreateActor("harv", self.Location + new int2(1, 2), self.Owner);
var unit = harvester.traits.Get<Unit>();
var mobile = harvester.traits.Get<Mobile>();
unit.Facing = 64;
harvester.QueueActivity(new Harvest());
});
}
public void OnDock(Actor harv)
{
self.traits.Get<RenderBuilding>().PlayCustomAnim(self, "active");
}
}
}