public Harvester(Actor self, HarvesterInfo info) { Info = info; mobile = self.Trait <Mobile>(); resLayer = self.World.WorldActor.Trait <ResourceLayer>(); claimLayer = self.World.WorldActor.Trait <ResourceClaimLayer>(); }
public ClearsResources(ClearsResourcesInfo info, Actor self) : base(info) { resLayer = self.World.WorldActor.Trait <ResourceLayer>(); resRenderer = self.World.WorldActor.Trait <ResourceRenderer>(); allCells = self.World.Map.ProjectedCells.ToArray(); }
protected override void TraitEnabled(Actor self) { pathfinder = world.WorldActor.Trait <IPathFinder>(); domainIndex = world.WorldActor.Trait <DomainIndex>(); resLayer = world.WorldActor.TraitOrDefault <ResourceLayer>(); claimLayer = world.WorldActor.TraitOrDefault <ResourceClaimLayer>(); scanForIdleHarvestersTicks = Info.ScanForIdleHarvestersInterval; }
public Harvester(Actor self, HarvesterInfo info) { Info = info; mobile = self.Trait <Mobile>(); resLayer = self.World.WorldActor.Trait <ResourceLayer>(); claimLayer = self.World.WorldActor.Trait <ResourceClaimLayer>(); self.QueueActivity(new CallFunc(() => ChooseNewProc(self, null))); }
public Harvester(Actor self, HarvesterInfo info) { Info = info; Contents = new ReadOnlyDictionary <ResourceTypeInfo, int>(contents); mobile = self.Trait <Mobile>(); resLayer = self.World.WorldActor.Trait <ResourceLayer>(); claimLayer = self.World.WorldActor.Trait <ResourceClaimLayer>(); }
public ResourceRenderer(Actor self, ResourceRendererInfo info) { Info = info; ResourceLayer = self.Trait <ResourceLayer>(); ResourceLayer.CellChanged += AddDirtyCell; RenderContent = new CellLayer <RendererCellContents>(self.World.Map); }
protected override void TraitEnabled(Actor self) { requestUnitProduction = player.PlayerActor.TraitsImplementing <IBotRequestUnitProduction>().ToArray(); pathfinder = world.WorldActor.Trait <IPathFinder>(); domainIndex = world.WorldActor.Trait <DomainIndex>(); resLayer = world.WorldActor.TraitOrDefault <ResourceLayer>(); claimLayer = world.WorldActor.TraitOrDefault <ResourceClaimLayer>(); scanForIdleHarvestersTicks = Info.ScanForIdleHarvestersInterval; }
protected override void TraitEnabled(Actor self) { pathfinder = world.WorldActor.Trait <IPathFinder>(); domainIndex = world.WorldActor.Trait <DomainIndex>(); resLayer = world.WorldActor.TraitOrDefault <ResourceLayer>(); claimLayer = world.WorldActor.TraitOrDefault <ResourceClaimLayer>(); // Avoid all AIs scanning for idle harvesters on the same tick, randomize their initial scan delay. scanForIdleHarvestersTicks = world.LocalRandom.Next(Info.ScanForIdleHarvestersInterval, Info.ScanForIdleHarvestersInterval * 2); }
public SeedsResource(Actor self, SeedsResourceInfo info) { this.info = info; resourceType = self.World.WorldActor.TraitsImplementing <ResourceType>() .FirstOrDefault(t => t.Info.Name == info.ResourceType); if (resourceType == null) { throw new InvalidOperationException("No such resource type `{0}`".F(info.ResourceType)); } resLayer = self.World.WorldActor.Trait <ResourceLayer>(); }
public DecaysResource(Actor self, DecaysResourceInfo info) : base(info) { this._info = info; _resLayer = self.World.WorldActor.Trait <ResourceLayer>(); }