Exemple #1
0
 public void Remove(SlayerTask task)
 {
     if (task == null)
     {
         return;
     }
     this.SlayerTasks.Remove(task);
 }
Exemple #2
0
 public void Add(SlayerTask task)
 {
     if (task == null)
     {
         return;
     }
     this.SlayerTasks.Add(task);
     task.SetOwner(this);
 }
Exemple #3
0
        public void AddTask()
        {
            SlayerTask          task   = CreateSlayerTask();
            DailySlayerTaskList parent = slayerPage.AddDaily();

            parent.Add(task);
            slayerPage.SlayerTasksView.UpdateLayout();
            slayerPage.UpdateTaskInfoContents();
            this.Close();
        }
Exemple #4
0
        private SlayerTask CreateSlayerTask()
        {
            SlayerTask     s           = null;
            string         monsterName = (string)MonsterListView.SelectedItem;
            SlayerMonsters monsterType = Slayer.SlayerLookUpTable.Where(entry => entry.Value.Key == monsterName).ElementAt(0).Key;

            UInt32.TryParse(MonstersKilledTextBox.Text, out uint amount);
            bool killedBoss          = BossCheckBox.IsChecked ?? false;
            uint?bossKills           = null;
            BossSlayerMonsters?bType = null;

            if (killedBoss)
            {
                UInt32.TryParse(BossKillsAmountTextBox.Text, out uint bossAmount);
                bossKills = bossAmount;
                bType     = Slayer.BossMonsterTypesLookUpTable.Where(entry => entry.Value == monsterType).ElementAt(0).Key;
            }

            bool iscancelled, isextended;

            iscancelled = CancelledCheckbox.IsChecked ?? false;
            isextended  = ExtendedCheckBox.IsChecked ?? false;
            SlayerBonuses codexBonus;

            codexBonus = (SlayerBonuses)Enum.Parse(typeof(SlayerBonuses), (string)CodexBonuses.SelectedItem);

            s = new SlayerTask(monsterType, amount, killedBoss, bossKills, bType, iscancelled, isextended, notes);
            if (ContractCheckBox.IsChecked ?? false)
            {
                s.InitExp(codexBonus, SlayerBonuses.SlayerContract);
            }
            else
            {
                s.InitExp(codexBonus);
            }
            return(s);
        }