public FlowerQueueItem(SavedFlowerState flower) { Target = new SpellTarget(flower.TargetMode, new Point(flower.LocationX, flower.LocationY), new Point(flower.OffsetX, flower.OffsetY)); Target.CharacterName = flower.CharacterName; Target.OuterRadius = flower.OuterRadius; Target.InnerRadius = flower.InnerRadius; Interval = flower.HasInterval ? flower.Interval : (TimeSpan?)null; ManaThreshold = flower.ManaThreshold > 0 ? flower.ManaThreshold : (int?)null; }
public SpellQueueItem(Spell spellInfo, SavedSpellState spell) { Icon = spellInfo.Icon; Name = spell.SpellName; Target = new SpellTarget(spell.TargetMode, new Point(spell.LocationX, spell.LocationY), new Point(spell.OffsetX, spell.OffsetY)); Target.CharacterName = spell.CharacterName; Target.OuterRadius = spell.OuterRadius; Target.InnerRadius = spell.InnerRadius; TargetLevel = spell.TargetLevel > 0 ? spell.TargetLevel : (int?)null; CurrentLevel = spellInfo.CurrentLevel; MaximumLevel = spellInfo.MaximumLevel; }
public SavedFlowerState(SpellTarget target, TimeSpan? interval, int? manaThreshold = null) { if (target == null) throw new ArgumentNullException("target"); TargetMode = target.Units; CharacterName = target.CharacterName; LocationX = target.Location.X; LocationY = target.Location.Y; OffsetX = target.Offset.X; OffsetY = target.Offset.Y; InnerRadius = target.InnerRadius; OuterRadius = target.OuterRadius; if (interval.HasValue) Interval = interval.Value; if (manaThreshold.HasValue) ManaThreshold = manaThreshold.Value; }
void SetTargetForMode(SpellTarget target) { if (target == null) return; targetModeComboBox.SelectedValue = target.Units.ToString(); switch (target.Units) { case TargetCoordinateUnits.Character: characterComboBox.SelectedValue = target.CharacterName; break; case TargetCoordinateUnits.AbsoluteTile: absoluteTileXUpDown.Value = target.Location.X; absoluteTileYUpDown.Value = target.Location.Y; break; case TargetCoordinateUnits.AbsoluteXY: absoluteXUpDown.Value = target.Location.X; absoluteYUpDown.Value = target.Location.Y; break; case TargetCoordinateUnits.RelativeTile: relativeTileXComboBox.SelectedItem = (int)target.Location.X; relativeTileYComboBox.SelectedItem = (int)target.Location.Y; break; case TargetCoordinateUnits.RelativeXY: relativeXUpDown.Value = target.Location.X; relativeYUpDown.Value = target.Location.Y; break; case TargetCoordinateUnits.RelativeRadius: innerRadiusUpDown.Value = target.InnerRadius; outerRadiusUpDown.Value = target.OuterRadius; goto case TargetCoordinateUnits.RelativeTile; case TargetCoordinateUnits.AbsoluteRadius: innerRadiusUpDown.Value = target.InnerRadius; outerRadiusUpDown.Value = target.OuterRadius; goto case TargetCoordinateUnits.AbsoluteTile; } offsetXUpDown.Value = target.Offset.X; offsetYUpDown.Value = target.Offset.Y; }