Ejemplo n.º 1
0
        private void Initialize(ClassConfiguration config)
        {
            ConfigurableInput  = new ConfigurableInput(logger, wowProcess, config);
            ActionBarPopulator = new ActionBarPopulator(logger, wowProcess, ConfigurableInput, config, AddonReader);

            var blacklist = config.Mode != Mode.Grind ? new NoBlacklist() : (IBlacklist) new Blacklist(AddonReader.PlayerReader, config.NPCMaxLevels_Above, config.NPCMaxLevels_Below, config.Blacklist, logger);

            var actionFactory    = new GoalFactory(logger, AddonReader, ConfigurableInput, DataConfig, npcNameFinder, pather);
            var availableActions = actionFactory.CreateGoals(config, blacklist);

            RouteInfo = actionFactory.RouteInfo;

            this.GoapAgent = new GoapAgent(logger, wowProcess, ConfigurableInput, AddonReader.PlayerReader, availableActions, blacklist, config, AddonReader.BagReader);

            this.actionThread = new GoalThread(logger, ConfigurableInput, AddonReader.PlayerReader, GoapAgent);

            // hookup events between actions
            availableActions.ToList().ForEach(a =>
            {
                a.ActionEvent += this.actionThread.OnActionEvent;
                a.ActionEvent += GoapAgent.OnActionEvent;

                // tell other action about my actions
                availableActions.ToList().ForEach(b =>
                {
                    if (b != a)
                    {
                        a.ActionEvent += b.OnActionEvent;
                    }
                });
            });
        }
Ejemplo n.º 2
0
 public GoalFactory(ILogger logger, AddonReader addonReader, ConfigurableInput input, DataConfig dataConfig, NpcNameFinder npcNameFinder, IPPather pather)
 {
     this.logger        = logger;
     this.addonReader   = addonReader;
     this.input         = input;
     this.dataConfig    = dataConfig;
     this.npcNameFinder = npcNameFinder;
     this.pather        = pather;
 }
Ejemplo n.º 3
0
 public MountHandler(ILogger logger, ConfigurableInput input, ClassConfiguration classConfig, Wait wait, PlayerReader playerReader, StopMoving stopMoving)
 {
     this.logger       = logger;
     this.classConfig  = classConfig;
     this.input        = input;
     this.wait         = wait;
     this.playerReader = playerReader;
     this.stopMoving   = stopMoving;
 }
Ejemplo n.º 4
0
        public CombatUtil(ILogger logger, ConfigurableInput input, Wait wait, PlayerReader playerReader)
        {
            this.logger       = logger;
            this.input        = input;
            this.wait         = wait;
            this.playerReader = playerReader;

            outOfCombat  = !playerReader.Bits.PlayerInCombat;
            lastPosition = playerReader.PlayerLocation;
        }
Ejemplo n.º 5
0
 public GoalFactory(ILogger logger, AddonReader addonReader, ConfigurableInput input, DataConfig dataConfig, NpcNameFinder npcNameFinder, NpcNameTargeting npcNameTargeting, IPPather pather, ExecGameCommand execGameCommand)
 {
     this.logger           = logger;
     this.addonReader      = addonReader;
     this.input            = input;
     this.dataConfig       = dataConfig;
     this.npcNameFinder    = npcNameFinder;
     this.npcNameTargeting = npcNameTargeting;
     this.pather           = pather;
     this.exec             = execGameCommand;
 }
Ejemplo n.º 6
0
        public StuckDetector(ILogger logger, ConfigurableInput input, PlayerReader playerReader, IPlayerDirection playerDirection, StopMoving stopMoving)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader    = playerReader;
            this.stopMoving      = stopMoving;
            this.playerDirection = playerDirection;

            ResetStuckParameters();
        }