Inheritance: IBotInfo, ITraitInfo
コード例 #1
0
        public HackyAI(HackyAIInfo info, ActorInitializer init)
        {
            Info  = info;
            World = init.World;

            if (World.Type == WorldType.Editor)
            {
                return;
            }

            domainIndex = World.WorldActor.Trait <DomainIndex>();
            resLayer    = World.WorldActor.Trait <ResourceLayer>();
            territory   = World.WorldActor.TraitOrDefault <ResourceClaimLayer>();
            pathfinder  = World.WorldActor.Trait <IPathFinder>();

            isEnemyUnit = unit =>
                          Player.Stances[unit.Owner] == Stance.Enemy &&
                          !unit.Info.HasTraitInfo <HuskInfo>() &&
                          unit.Info.HasTraitInfo <ITargetableInfo>();

            unitCannotBeOrdered = a => a.Owner != Player || a.IsDead || !a.IsInWorld;

            foreach (var decision in info.PowerDecisions)
            {
                powerDecisions.Add(decision.OrderName, decision);
            }
        }
コード例 #2
0
ファイル: HackyAI.cs プロジェクト: ushalin/OpenRA
        public HackyAI(HackyAIInfo info, ActorInitializer init)
        {
            Info  = info;
            World = init.World;

            foreach (var decision in info.PowerDecisions)
            {
                powerDecisions.Add(decision.OrderName, decision);
            }
        }
コード例 #3
0
        public HackyAI(HackyAIInfo info, ActorInitializer init)
        {
            Info  = info;
            World = init.World;

            if (World.Type == WorldType.Editor)
            {
                return;
            }

            isEnemyUnit = unit =>
                          Player.Stances[unit.Owner] == Stance.Enemy &&
                          !unit.Info.HasTraitInfo <HuskInfo>() &&
                          unit.Info.HasTraitInfo <ITargetableInfo>();

            unitCannotBeOrdered = a => a.Owner != Player || a.IsDead || !a.IsInWorld;

            maximumCaptureTargetOptions = Math.Max(1, Info.MaximumCaptureTargetOptions);
        }
コード例 #4
0
ファイル: HackyAI.cs プロジェクト: Roger-luo/OpenRA
		public HackyAI(HackyAIInfo info, ActorInitializer init)
		{
			Info = info;
			World = init.World;

			if (World.Type == WorldType.Editor)
				return;

			domainIndex = World.WorldActor.Trait<DomainIndex>();
			resLayer = World.WorldActor.Trait<ResourceLayer>();
			territory = World.WorldActor.TraitOrDefault<ResourceClaimLayer>();
			pathfinder = World.WorldActor.Trait<IPathFinder>();

			isEnemyUnit = unit =>
				Player.Stances[unit.Owner] == Stance.Enemy
					&& !unit.Info.HasTraitInfo<HuskInfo>()
					&& unit.Info.HasTraitInfo<ITargetableInfo>();

			unitCannotBeOrdered = a => a.Owner != Player || a.IsDead || !a.IsInWorld;

			foreach (var decision in info.PowerDecisions)
				powerDecisions.Add(decision.OrderName, decision);
		}