Example #1
0
        public AdhocNPCGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, IPlayerDirection playerDirection, StopMoving stopMoving, NpcNameFinder npcNameFinder, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, KeyAction key, IBlacklist blacklist)
        {
            this.logger          = logger;
            this.input           = input;
            this.playerReader    = playerReader;
            this.playerDirection = playerDirection;
            this.stopMoving      = stopMoving;
            this.npcNameFinder   = npcNameFinder;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.key       = key;
            this.blacklist = blacklist;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
        public FollowRouteGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, IPlayerDirection playerDirection, List <WowPoint> points, StopMoving stopMoving, NpcNameFinder npcNameFinder, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, MountHandler mountHandler, TargetFinder targetFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.wait            = wait;
            this.addonReader     = addonReader;
            this.playerReader    = addonReader.PlayerReader;
            this.playerDirection = playerDirection;
            this.stopMoving      = stopMoving;

            this.pointsList = points;

            this.npcNameFinder = npcNameFinder;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.mountHandler       = mountHandler;
            this.targetFinder       = targetFinder;

            MinDistance = !(pather is RemotePathingAPIV3) ? 15 : 8;

            if (classConfiguration.Mode != Mode.AttendedGather)
            {
                AddPrecondition(GoapKey.incombat, false);
                AddPrecondition(GoapKey.producedcorpse, false);
                AddPrecondition(GoapKey.consumecorpse, false);
            }
        }
Example #3
0
        public AdhocNPCGoal(ILogger logger, ConfigurableInput input, AddonReader addonReader, IPlayerDirection playerDirection, StopMoving stopMoving, NpcNameTargeting npcNameTargeting, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, KeyAction key, IBlacklist blacklist, MountHandler mountHandler, Wait wait, ExecGameCommand exec)
        {
            this.logger           = logger;
            this.input            = input;
            this.addonReader      = addonReader;
            this.playerReader     = addonReader.PlayerReader;
            this.playerDirection  = playerDirection;
            this.stopMoving       = stopMoving;
            this.npcNameTargeting = npcNameTargeting;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.key          = key;
            this.blacklist    = blacklist;
            this.mountHandler = mountHandler;

            this.wait            = wait;
            this.execGameCommand = exec;
            this.gossipReader    = addonReader.GossipReader;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
        public LastTargetLoot(ILogger logger, ConfigurableInput input, PlayerReader playerReader, ClassConfiguration classConfiguration)
        {
            this.logger       = logger;
            this.input        = input;
            this.playerReader = playerReader;

            this.classConfiguration = classConfiguration;
        }
Example #5
0
 public GoapAgent(PlayerReader playerReader, HashSet <GoapGoal> availableGoals, IBlacklist blacklist, ILogger logger, ClassConfiguration classConfiguration)
 {
     this.playerReader       = playerReader;
     this.AvailableGoals     = availableGoals.OrderBy(a => a.CostOfPerformingAction);
     this.blacklist          = blacklist;
     this.logger             = logger;
     this.planner            = new GoapPlanner(logger);
     this.classConfiguration = classConfiguration;
 }
Example #6
0
 public CastingHandler(WowProcess wowProcess, PlayerReader playerReader, ILogger logger, ClassConfiguration classConfiguration, IPlayerDirection direction, NpcNameFinder npcNameFinder)
 {
     this.wowProcess         = wowProcess;
     this.playerReader       = playerReader;
     this.logger             = logger;
     this.classConfiguration = classConfiguration;
     this.direction          = direction;
     this.npcNameFinder      = npcNameFinder;
 }
Example #7
0
 public WrongZoneAction(PlayerReader playerReader, WowProcess wowProcess, IPlayerDirection playerDirection, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
 {
     this.playerReader       = playerReader;
     this.wowProcess         = wowProcess;
     this.playerDirection    = playerDirection;
     this.logger             = logger;
     this.stuckDetector      = stuckDetector;
     this.classConfiguration = classConfiguration;
     AddPrecondition(GoapKey.incombat, false);
 }
 public WrongZoneGoal(PlayerReader playerReader, ConfigurableInput input, IPlayerDirection playerDirection, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
 {
     this.playerReader       = playerReader;
     this.input              = input;
     this.playerDirection    = playerDirection;
     this.logger             = logger;
     this.stuckDetector      = stuckDetector;
     this.classConfiguration = classConfiguration;
     AddPrecondition(GoapKey.incombat, false);
 }
Example #9
0
        public TargetFinder(ILogger logger, ConfigurableInput input, ClassConfiguration classConfig, Wait wait, PlayerReader playerReader, IBlacklist blacklist, NpcNameTargeting npcNameTargeting)
        {
            this.logger       = logger;
            this.classConfig  = classConfig;
            this.input        = input;
            this.wait         = wait;
            this.playerReader = playerReader;

            this.blacklist        = blacklist;
            this.npcNameTargeting = npcNameTargeting;
        }
        public CastingHandler(ILogger logger, ConfigurableInput input, PlayerReader playerReader, ClassConfiguration classConfig, IPlayerDirection direction, NpcNameFinder npcNameFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader = playerReader;

            this.classConfig   = classConfig;
            this.direction     = direction;
            this.npcNameFinder = npcNameFinder;
        }
        public void Setup_Constructor()
        {
            // Arrange ////
            var classConfiguration = new ClassConfiguration(typeof(ITest1), TestConstructorName);

            // Act ////
            var ctr = classConfiguration.WithConstructor();

            // Assert ////
            Assert.NotNull(ctr);
        }
Example #12
0
        public LootGoal(WowProcess wowProcess, PlayerReader playerReader, BagReader bagReader, StopMoving stopMoving, ILogger logger, ClassConfiguration classConfiguration)
        {
            this.wowProcess         = wowProcess;
            this.playerReader       = playerReader;
            this.stopMoving         = stopMoving;
            this.bagReader          = bagReader;
            this.logger             = logger;
            this.classConfiguration = classConfiguration;

            lootWheel = new LootWheel(wowProcess, playerReader, logger);
        }
Example #13
0
        public ApproachTargetGoal(WowProcess wowProcess, PlayerReader playerReader, StopMoving stopMoving, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.wowProcess         = wowProcess;
            this.playerReader       = playerReader;
            this.stopMoving         = stopMoving;
            this.logger             = logger;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            AddPrecondition(GoapKey.incombatrange, false);
            AddPrecondition(GoapKey.targetisalive, true);
        }
        public NPCGoal(PlayerReader playerReader, WowProcess wowProcess, IPlayerDirection playerDirection, StopMoving stopMoving, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, BagReader bagReader)
        {
            this.playerReader    = playerReader;
            this.wowProcess      = wowProcess;
            this.playerDirection = playerDirection;
            this.stopMoving      = stopMoving;
            this.bagReader       = bagReader;

            this.logger             = logger;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
        }
Example #15
0
        public LootGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, BagReader bagReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameFinder npcNameFinder)
        {
            this.logger       = logger;
            this.input        = input;
            this.playerReader = playerReader;
            this.stopMoving   = stopMoving;
            this.bagReader    = bagReader;

            this.classConfiguration = classConfiguration;
            this.npcNameFinder      = npcNameFinder;

            outOfCombat = playerReader.PlayerBitValues.PlayerInCombat;
        }
Example #16
0
        public GoapAgent(ILogger logger, WowProcess wowProcess, ConfigurableInput input, PlayerReader playerReader, HashSet <GoapGoal> availableGoals, IBlacklist blacklist, ClassConfiguration classConfiguration, BagReader bagReader)
        {
            this.logger     = logger;
            this.wowProcess = wowProcess;
            this.input      = input;

            this.playerReader   = playerReader;
            this.AvailableGoals = availableGoals.OrderBy(a => a.CostOfPerformingAction);
            this.blacklist      = blacklist;

            this.planner            = new GoapPlanner(logger);
            this.classConfiguration = classConfiguration;
            this.bagReader          = bagReader;
        }
        public CastingHandler(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, ClassConfiguration classConfig, IPlayerDirection direction, NpcNameFinder npcNameFinder, StopMoving stopMoving)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.addonReader  = addonReader;
            this.playerReader = addonReader.PlayerReader;

            this.classConfig   = classConfig;
            this.direction     = direction;
            this.npcNameFinder = npcNameFinder;
            this.stopMoving    = stopMoving;
        }
        public CombatAction(WowProcess wowProcess, PlayerReader playerReader, StopMoving stopMoving, ILogger logger, ClassConfiguration classConfiguration, CastingHandler castingHandler)
        {
            this.wowProcess         = wowProcess;
            this.playerReader       = playerReader;
            this.stopMoving         = stopMoving;
            this.logger             = logger;
            this.classConfiguration = classConfiguration;
            this.castingHandler     = castingHandler;

            AddPrecondition(GoapKey.incombat, true);
            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.incombatrange, true);

            this.classConfiguration.Combat.Sequence.Where(k => k != null).ToList().ForEach(key => this.Keys.Add(key));
        }
        public LootGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.playerReader = addonReader.PlayerReader;
            this.areaDb       = addonReader.AreaDb;
            this.stopMoving   = stopMoving;
            this.bagReader    = addonReader.BagReader;

            this.classConfiguration = classConfiguration;
            this.npcNameTargeting   = npcNameTargeting;
            this.combatUtil         = combatUtil;
        }
        public FollowRouteAction(PlayerReader playerReader, WowProcess wowProcess, IPlayerDirection playerDirection, List <WowPoint> points, StopMoving stopMoving, NpcNameFinder npcNameFinder, IBlacklist blacklist, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.playerReader       = playerReader;
            this.wowProcess         = wowProcess;
            this.playerDirection    = playerDirection;
            this.stopMoving         = stopMoving;
            this.pointsList         = points;
            this.npcNameFinder      = npcNameFinder;
            this.blacklist          = blacklist;
            this.logger             = logger;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            AddPrecondition(GoapKey.incombat, false);
        }
        static void Main(string[] args)
        {
            var methodConfig = new MethodConfiguration("ToSimulationVariables", ReturnTypes.Normal, MethodTypes.Dependent);

            var classConfig = new ClassConfiguration("VariableStructureTransformer", ClassTypes.Dependent);
            classConfig.Methods.Add(methodConfig);
            //var classConfig = new ClassConfiguration("FileConfiguration", ClassTypes.Data);

            //classConfig.Properties.Add(new PropertyConfiguration<string>("Name"));
            //classConfig.Properties.Add(new PropertyConfiguration<INsCodeNamespace>("Namespace"));

            var generator = new Generator();

            generator.Generate(classConfig);
        }
        public IConstructor RegisterType <T, TR>(string name)
            where T : class
            where TR : T
        {
            if (IsRegistered <T>(name))
            {
                throw new TypeLoadException(TypeExistsErrorMessage);
            }

            var type = typeof(TR);

            var configuration = new ClassConfiguration(type, name);
            var factory       = new ClassFactory(type, configuration);

            _factoryMap.Add(typeof(T), name, factory);
            return(configuration.Constructor);
        }
        public ApproachTargetAction(WowProcess wowProcess, PlayerReader playerReader, StopMoving stopMoving, NpcNameFinder npcNameFinder, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.wowProcess         = wowProcess;
            this.playerReader       = playerReader;
            this.stopMoving         = stopMoving;
            this.npcNameFinder      = npcNameFinder;
            this.logger             = logger;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            AddPrecondition(GoapKey.incombatrange, false);
            AddPrecondition(GoapKey.targetisalive, true);

            var rect = wowProcess.GetWindowRect();

            mouseLocationOfAdd = new Point((int)(rect.right / 2f), (int)((rect.bottom / 20) * 13f));
        }
Example #24
0
        public PullTargetAction(WowProcess wowProcess, PlayerReader playerReader, NpcNameFinder npcNameFinder, StopMoving stopMoving, ILogger logger, CastingHandler castingHandler, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.wowProcess         = wowProcess;
            this.playerReader       = playerReader;
            this.npcNameFinder      = npcNameFinder;
            this.stopMoving         = stopMoving;
            this.logger             = logger;
            this.castingHandler     = castingHandler;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.pulled, false);
            AddPrecondition(GoapKey.withinpullrange, true);
            AddEffect(GoapKey.pulled, true);

            this.classConfiguration.Pull.Sequence.Where(k => k != null).ToList().ForEach(key => this.Keys.Add(key));
        }
        public SkinningGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, BagReader bagReader, EquipmentReader equipmentReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameFinder npcNameFinder)
        {
            this.logger = logger;
            this.input  = input;

            this.playerReader    = playerReader;
            this.stopMoving      = stopMoving;
            this.bagReader       = bagReader;
            this.equipmentReader = equipmentReader;


            this.classConfiguration = classConfiguration;
            this.npcNameFinder      = npcNameFinder;

            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.shouldskin, true);

            AddEffect(GoapKey.shouldskin, false);

            outOfCombat = playerReader.PlayerBitValues.PlayerInCombat;
        }
        public CreatureKilledGoal(ILogger logger, PlayerReader playerReader, ClassConfiguration classConfig)
        {
            this.logger       = logger;
            this.playerReader = playerReader;
            this.classConfig  = classConfig;

            AddPrecondition(GoapKey.producedcorpse, true);
            AddPrecondition(GoapKey.consumecorpse, false);

            AddEffect(GoapKey.producedcorpse, false);
            AddEffect(GoapKey.consumecorpse, true);

            if (classConfig.Loot)
            {
                AddEffect(GoapKey.shouldloot, true);

                if (classConfig.Skin)
                {
                    AddEffect(GoapKey.shouldskin, true);
                }
            }
        }
Example #27
0
        public AdhocNPCGoal(PlayerReader playerReader, WowProcess wowProcess, IPlayerDirection playerDirection, StopMoving stopMoving, ILogger logger, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather, KeyAction key)
        {
            this.playerReader       = playerReader;
            this.wowProcess         = wowProcess;
            this.playerDirection    = playerDirection;
            this.stopMoving         = stopMoving;
            this.logger             = logger;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;
            this.key = key;

            if (key.InCombat == "false")
            {
                AddPrecondition(GoapKey.incombat, false);
            }
            else if (key.InCombat == "true")
            {
                AddPrecondition(GoapKey.incombat, true);
            }

            this.Keys.Add(key);
        }
        public ConsumeCorpse(ILogger logger, ClassConfiguration classConfig)
        {
            this.logger      = logger;
            this.classConfig = classConfig;

            AddPrecondition(GoapKey.dangercombat, false);

            AddPrecondition(GoapKey.producedcorpse, true);
            AddPrecondition(GoapKey.consumecorpse, false);

            AddEffect(GoapKey.producedcorpse, false);
            AddEffect(GoapKey.consumecorpse, true);

            if (classConfig.Loot)
            {
                AddEffect(GoapKey.shouldloot, true);

                if (classConfig.Skin)
                {
                    AddEffect(GoapKey.shouldskin, true);
                }
            }
        }
Example #29
0
        public FollowRouteGoal(ILogger logger, ConfigurableInput input, PlayerReader playerReader, IPlayerDirection playerDirection, List <WowPoint> points, StopMoving stopMoving, NpcNameFinder npcNameFinder, IBlacklist blacklist, StuckDetector stuckDetector, ClassConfiguration classConfiguration, IPPather pather)
        {
            this.logger = logger;
            this.input  = input;

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

            this.pointsList = points;

            this.npcNameFinder = npcNameFinder;
            this.blacklist     = blacklist;

            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;
            this.pather             = pather;

            if (classConfiguration.Mode != Mode.AttendedGather)
            {
                AddPrecondition(GoapKey.incombat, false);
            }
        }
        public PullTargetGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, CastingHandler castingHandler, StuckDetector stuckDetector, ClassConfiguration classConfiguration)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.addonReader  = addonReader;
            this.playerReader = addonReader.PlayerReader;
            this.stopMoving   = stopMoving;

            this.castingHandler     = castingHandler;
            this.stuckDetector      = stuckDetector;
            this.classConfiguration = classConfiguration;

            classConfiguration.Pull.Sequence.Where(k => k != null).ToList().ForEach(key => Keys.Add(key));

            AddPrecondition(GoapKey.targetisalive, true);
            AddPrecondition(GoapKey.incombat, false);
            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.pulled, false);
            AddPrecondition(GoapKey.withinpullrange, true);

            AddEffect(GoapKey.pulled, true);
        }
        public CombatGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, ClassConfiguration classConfiguration, CastingHandler castingHandler)
        {
            this.logger = logger;
            this.input  = input;

            this.wait         = wait;
            this.addonReader  = addonReader;
            this.playerReader = addonReader.PlayerReader;
            this.stopMoving   = stopMoving;

            this.classConfiguration = classConfiguration;
            this.castingHandler     = castingHandler;

            AddPrecondition(GoapKey.incombat, true);
            AddPrecondition(GoapKey.hastarget, true);
            AddPrecondition(GoapKey.targetisalive, true);
            AddPrecondition(GoapKey.incombatrange, true);

            AddEffect(GoapKey.producedcorpse, true);
            AddEffect(GoapKey.targetisalive, false);
            AddEffect(GoapKey.hastarget, false);

            classConfiguration.Combat.Sequence.Where(k => k != null).ToList().ForEach(key => Keys.Add(key));
        }