Пример #1
0
 public TrapBuilderForm(Masterplan.Data.Trap trap)
 {
     this.InitializeComponent();
     Application.Idle += new EventHandler(this.Application_Idle);
     this.fTrap        = trap.Copy();
     this.update_statblock();
 }
Пример #2
0
            public int Compare(object x, object y)
            {
                ListViewItem listViewItem  = x as ListViewItem;
                ListViewItem listViewItem1 = y as ListViewItem;
                int          num           = 0;

                switch (this.fColumn)
                {
                case 0:
                {
                    ListViewItem.ListViewSubItem item            = listViewItem.SubItems[this.fColumn];
                    ListViewItem.ListViewSubItem listViewSubItem = listViewItem1.SubItems[this.fColumn];
                    num = item.Text.CompareTo(listViewSubItem.Text);
                    break;
                }

                case 1:
                {
                    Masterplan.Data.Trap tag  = listViewItem.Tag as Masterplan.Data.Trap;
                    Masterplan.Data.Trap trap = listViewItem1.Tag as Masterplan.Data.Trap;
                    num = tag.Level.CompareTo(trap.Level);
                    break;
                }
                }
                if (!this.fAscending)
                {
                    num *= -1;
                }
                return(num);
            }
Пример #3
0
 private bool match_token(Masterplan.Data.Trap trap, string token)
 {
     if (trap.Name.ToLower().Contains(token))
     {
         return(true);
     }
     return(false);
 }
Пример #4
0
        private void OptionsCopy_Click(object sender, EventArgs e)
        {
            TrapSelectForm trapSelectForm = new TrapSelectForm();

            if (trapSelectForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.fTrap = trapSelectForm.Trap.Copy();
                this.update_statblock();
            }
        }
Пример #5
0
 private bool match(Masterplan.Data.Trap trap, string query)
 {
     string[] strArrays = query.ToLower().Split(new char[0]);
     for (int i = 0; i < (int)strArrays.Length; i++)
     {
         if (!this.match_token(trap, strArrays[i]))
         {
             return(false);
         }
     }
     return(true);
 }
Пример #6
0
 public TrapProfileForm(Masterplan.Data.Trap trap)
 {
     this.InitializeComponent();
     foreach (TrapType value in Enum.GetValues(typeof(TrapType)))
     {
         this.TypeBox.Items.Add(value);
     }
     Application.Idle         += new EventHandler(this.Application_Idle);
     this.fTrap                = trap.Copy();
     this.NameBox.Text         = this.fTrap.Name;
     this.TypeBox.SelectedItem = this.fTrap.Type;
     this.LevelBox.Value       = this.fTrap.Level;
     this.RoleBtn.Text         = this.fTrap.Role.ToString();
     if (this.fTrap.Initiative == -2147483648)
     {
         this.HasInitBox.Checked = false;
         this.InitBox.Value      = new decimal(0);
         return;
     }
     this.HasInitBox.Checked = true;
     this.InitBox.Value      = this.fTrap.Initiative;
 }