Exemplo n.º 1
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            this.playerReader = playerReader;
            this.logger       = logger;

            if (!string.IsNullOrEmpty(this.Requirement))
            {
                Requirements.Add(this.Requirement);
            }

            requirementFactory.InitialiseRequirements(this);

            if (!string.IsNullOrEmpty(ShapeShiftForm))
            {
                if (Enum.TryParse(typeof(ShapeshiftForm), ShapeShiftForm, out var desiredForm))
                {
                    this.ShapeShiftFormEnum = (ShapeshiftForm)desiredForm;
                }
                else
                {
                    logger.LogInformation($"Unknown shapeshift form: {ShapeShiftForm}");
                }
            }

            KeyReader.ReadKey(logger, this);
        }
Exemplo n.º 2
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            Pull.Initialise(playerReader, requirementFactory, logger);
            Combat.Initialise(playerReader, requirementFactory, logger);
            Adhoc.Initialise(playerReader, requirementFactory, logger);
            Parallel.Initialise(playerReader, requirementFactory, logger);
            ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));

            Interact.Key = InteractKey;
            Interact.Initialise(playerReader, requirementFactory, logger);

            if (string.IsNullOrEmpty(Blink.Key))
            {
                Blink.Key = " ";
            }
            Blink.Initialise(playerReader, requirementFactory, logger);

            TargetLastTarget.Key = TargetLastTargetKey;
            TargetLastTarget.Initialise(playerReader, requirementFactory, logger);

            GatherFindKeys.ForEach(key =>
            {
                GatherFindKeyConfig.Add(new KeyAction {
                    Key = key
                });
                GatherFindKeyConfig.Last().Initialise(playerReader, requirementFactory, logger);
            });
        }
Exemplo n.º 3
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            Pull.Initialise(playerReader, requirementFactory, logger);
            Combat.Initialise(playerReader, requirementFactory, logger);
            Adhoc.Initialise(playerReader, requirementFactory, logger);
            Parallel.Initialise(playerReader, requirementFactory, logger);
            ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));

            Interact.Key = InteractKey;
            Interact.Initialise(playerReader, requirementFactory, logger);
            Blink.Initialise(playerReader, requirementFactory, logger);
        }
Exemplo n.º 4
0
        private ClassConfiguration ReadClassConfiguration()
        {
            ClassConfiguration classConfig;
            var requirementFactory = new RequirementFactory(AddonReader.PlayerReader, AddonReader.BagReader, logger);

            var classFilename = $"../json/class/{AddonReader.PlayerReader.PlayerClass.ToString()}.json";

            if (File.Exists(classFilename))
            {
                classConfig = JsonConvert.DeserializeObject <ClassConfiguration>(File.ReadAllText(classFilename));
                classConfig.Initialise(AddonReader.PlayerReader, requirementFactory, logger);
                return(classConfig);
            }

            throw new ArgumentOutOfRangeException($"Class config file not found {classFilename}");
        }
 public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
 {
     Sequence.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));
 }