コード例 #1
0
ファイル: SettingsWindow.xaml.cs プロジェクト: Kalavarda/AA
        public SettingsWindow()
        {
            InitializeComponent();

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

            _flashBefore.Text    = Settings.Default.FlashBefore.ToString();
            _listBox.ItemsSource = _buffTypes;
        }
コード例 #2
0
ファイル: SettingsWindow.xaml.cs プロジェクト: Kalavarda/AA
        private void OnAddClick(object sender, RoutedEventArgs e)
        {
            var buffType = new BuffType();

            if (new BuffTypeWindow(buffType)
            {
                Owner = this
            }.ShowDialog() == true)
            {
                _buffTypes.Add(buffType);
                SelectedBuffType = buffType;
            }
        }
コード例 #3
0
ファイル: Buff.cs プロジェクト: QifanYang-bw/Sortilege
        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;
            }
        }
コード例 #4
0
ファイル: Buff.cs プロジェクト: pchuh/PathToHarmony
 public Buff(BuffType buffType)
 {
     this.buffType = buffType;
 }
コード例 #5
0
 private static IDictionary <string, Buff> GetBuffs()
 {
     return(BuffType.Deserialize(Settings.Default.Types).ToDictionary(bt => bt.ImageUri, bt => new Buff(bt.Duration)));
 }