Rework harvester automation.

This commit is contained in:
tovl
2019-03-22 20:42:05 +01:00
committed by reaperrr
parent 1d590ac207
commit ea4f24d0b7
9 changed files with 117 additions and 120 deletions

View File

@@ -9,6 +9,7 @@
*/
#endregion
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;
@@ -18,19 +19,15 @@ namespace OpenRA.Mods.Common.Scripting
[ScriptPropertyGroup("Movement")]
public class HarvesterProperties : ScriptActorProperties, Requires<HarvesterInfo>
{
readonly Harvester harvester;
public HarvesterProperties(ScriptContext context, Actor self)
: base(context, self)
{
harvester = self.Trait<Harvester>();
}
{ }
[ScriptActorPropertyActivity]
[Desc("Search for nearby resources and begin harvesting.")]
public void FindResources()
{
harvester.ContinueHarvesting(Self);
Self.QueueActivity(new FindAndDeliverResources(Self));
}
}
}