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); } }
public HackyAI(HackyAIInfo info, ActorInitializer init) { Info = info; World = init.World; foreach (var decision in info.PowerDecisions) { powerDecisions.Add(decision.OrderName, decision); } }
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); }
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); }