Beispiel #1
0
 public Harvester(Actor self, HarvesterInfo info)
 {
     Info       = info;
     mobile     = self.Trait <Mobile>();
     resLayer   = self.World.WorldActor.Trait <ResourceLayer>();
     claimLayer = self.World.WorldActor.Trait <ResourceClaimLayer>();
 }
Beispiel #2
0
 public Harvester(Actor self, HarvesterInfo info)
     : base(info)
 {
     Contents      = new ReadOnlyDictionary <string, int>(contents);
     mobile        = self.Trait <Mobile>();
     resourceLayer = self.World.WorldActor.Trait <IResourceLayer>();
     claimLayer    = self.World.WorldActor.Trait <ResourceClaimLayer>();
 }
Beispiel #3
0
        protected override void TraitEnabled(Actor self)
        {
            resourceLayer = world.WorldActor.TraitOrDefault <IResourceLayer>();
            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);
        }
Beispiel #4
0
 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;
 }
Beispiel #5
0
        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)));
        }
Beispiel #6
0
        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>();
        }
Beispiel #7
0
 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;
 }