Remove InitialActivity

This commit is contained in:
reaperrr
2015-07-07 03:48:25 +02:00
parent 69c49c0139
commit 1baae6653c
11 changed files with 22 additions and 31 deletions

View File

@@ -42,6 +42,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Percentage of maximum speed when fully loaded.")]
public readonly int FullyLoadedSpeed = 85;
[Desc("Automatically scan for resources when created.")]
public readonly bool SearchOnCreation = true;
[Desc("Initial search radius (in cells) from the refinery that created us.")]
public readonly int SearchFromProcRadius = 24;
@@ -55,8 +58,8 @@ namespace OpenRA.Mods.Common.Traits
}
public class Harvester : IIssueOrder, IResolveOrder, IPips,
IExplodeModifier, IOrderVoice, ISpeedModifier, ISync,
INotifyResourceClaimLost, INotifyIdle, INotifyBlockingMove
IExplodeModifier, IOrderVoice, ISpeedModifier, ISync, INotifyCreated,
INotifyResourceClaimLost, INotifyIdle, INotifyBlockingMove, INotifyBuildComplete
{
readonly HarvesterInfo info;
Dictionary<ResourceTypeInfo, int> contents = new Dictionary<ResourceTypeInfo, int>();
@@ -76,6 +79,18 @@ namespace OpenRA.Mods.Common.Traits
self.QueueActivity(new CallFunc(() => ChooseNewProc(self, null)));
}
public void Created(Actor self)
{
if (info.SearchOnCreation)
self.QueueActivity(new FindResources());
}
public void BuildingComplete(Actor self)
{
if (info.SearchOnCreation)
self.QueueActivity(new FindResources());
}
public void SetProcLines(Actor proc)
{
if (proc == null) return;