Ejemplo n.º 1
0
        public SettingsWindow()
        {
            InitializeComponent();

            foreach (var line in BuffType.Deserialize(Settings.Default.Types))
            {
                _buffTypes.Add(line);
            }

            _flashBefore.Text    = Settings.Default.FlashBefore.ToString();
            _listBox.ItemsSource = _buffTypes;
        }
Ejemplo n.º 2
0
        private void OnAddClick(object sender, RoutedEventArgs e)
        {
            var buffType = new BuffType();

            if (new BuffTypeWindow(buffType)
            {
                Owner = this
            }.ShowDialog() == true)
            {
                _buffTypes.Add(buffType);
                SelectedBuffType = buffType;
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
 public Buff(BuffType buffType)
 {
     this.buffType = buffType;
 }
Ejemplo n.º 5
0
 private static IDictionary <string, Buff> GetBuffs()
 {
     return(BuffType.Deserialize(Settings.Default.Types).ToDictionary(bt => bt.ImageUri, bt => new Buff(bt.Duration)));
 }