public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger) { this.playerReader = playerReader; this.logger = logger; ResetChanges(); 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); }
public void Initialise(AddonReader addonReader, RequirementFactory requirementFactory, ILogger logger) { this.playerReader = addonReader.PlayerReader; this.logger = logger; ResetCharges(); KeyReader.ReadKey(logger, this); if (!string.IsNullOrEmpty(this.Requirement)) { Requirements.Add(this.Requirement); } if (HasFormRequirement()) { if (Enum.TryParse(typeof(Form), Form, out var desiredForm)) { this.FormEnum = (Form)desiredForm; this.logger.LogInformation($"[{Name}] Required Form: {FormEnum}"); if (KeyReader.ActionBarSlotMap.TryGetValue(Key, out int slot)) { int offset = Stance.RuntimeSlotToActionBar(this, playerReader, slot); this.logger.LogInformation($"[{Name}] Actionbar Form key map: Key:{Key} -> Actionbar:{slot} -> Form Map:{slot + offset}"); } } else { logger.LogInformation($"Unknown form: {Form}"); } } ConsoleKeyFormHash = ((int)FormEnum * 1000) + (int)ConsoleKey; UpdateMinResourceRequirement(playerReader, addonReader.ActionBarCostReader); requirementFactory.InitialiseRequirements(this); }