public SettingsWindow() { InitializeComponent(); foreach (var line in BuffType.Deserialize(Settings.Default.Types)) { _buffTypes.Add(line); } _flashBefore.Text = Settings.Default.FlashBefore.ToString(); _listBox.ItemsSource = _buffTypes; }
private void OnAddClick(object sender, RoutedEventArgs e) { var buffType = new BuffType(); if (new BuffTypeWindow(buffType) { Owner = this }.ShowDialog() == true) { _buffTypes.Add(buffType); SelectedBuffType = buffType; } }
public void Initialize(BuffType buffType, float buffAmount) { type = buffType; amount = buffAmount; switch (type) { // Bind them to individual functions case BuffType.Block: // Todo: Check if an instance of self already exists GetComponentInParent <Unit>().onDamage.AddListener(Block); break; case BuffType.Forge: GetComponentInParent <Unit>().onTurnBegin.AddListener(Forge); break; case BuffType.Thorns: GetComponentInParent <Unit>().onDamage.AddListener(Thorns); break; case BuffType.Plague: GetComponentInParent <Unit>().onTurnBegin.AddListener(Plague); break; case BuffType.Flinch: GetComponentInParent <Unit>().onAttack.AddListener(Flinch); break; case BuffType.Voodoo: GetComponentInParent <Unit>().onTurnBegin.AddListener(Voodoo); break; case BuffType.Breeze: throw new NotImplementedException(); // break; } }
public Buff(BuffType buffType) { this.buffType = buffType; }
private static IDictionary <string, Buff> GetBuffs() { return(BuffType.Deserialize(Settings.Default.Types).ToDictionary(bt => bt.ImageUri, bt => new Buff(bt.Duration))); }