public void UpdateDetails(WoWNameCache nameCache) { Details = GetNpcDetails() ?? nameCache.GetNameByGuid(Guid); }
public override void Update() { if ((Profile == null) || (DataModel == null) || (_process == null)) return; var dataModel = (WoWDataModel) DataModel; var objectManager = new WoWObjectManager(_process, _pointer.GameAddresses.First(a => a.Description == "ObjectManager").BasePointer); var nameCache = new WoWNameCache(_process, _pointer.GameAddresses.First(a => a.Description == "NameCache").BasePointer); var player = new WoWPlayer(_process, _pointer.GameAddresses.First(a => a.Description == "LocalPlayer").BasePointer, _pointer.GameAddresses.First(a => a.Description == "TargetGuid").BasePointer, true); dataModel.Player = player; if (dataModel.Player != null && dataModel.Player.Guid != Guid.Empty) { dataModel.Player.UpdateDetails(nameCache); var target = player.GetTarget(objectManager); if (target == null) return; dataModel.Target = new WoWUnit(target.Process, target.BaseAddress); dataModel.Target.UpdateDetails(nameCache); } else { dataModel.Target = null; } }