public List<SItemBonus> GetBonusList() { List<SItemBonus> bonus = new List<SItemBonus>(); for( int i = 0; i < mBonusCount; i++ ) { SItemBonus b = new SItemBonus(); b.Type = (EItemBonus)( Controls[ "cb" + i ] as ComboBox ).SelectedIndex; b.Value = (int)( Controls[ "num" + i ] as NumericUpDown ).Value; if( b.Value == 0 ) continue; bonus.Add( b ); } return bonus; }
public List <SItemBonus> GetBonusList() { List <SItemBonus> bonus = new List <SItemBonus>(); for (int i = 0; i < mBonusCount; i++) { SItemBonus b = new SItemBonus(); b.Type = (EItemBonus)(Controls["cb" + i] as ComboBox).SelectedIndex; b.Value = (int)(Controls["num" + i] as NumericUpDown).Value; if (b.Value == 0) { continue; } bonus.Add(b); } return(bonus); }