public Feats(byte[] dates, byte[] states) { allFeats = new List <Feat>(96); for (int i = 0; i < 96; i++) { Feat f = new Feat(); f.Date = StupidDate.GetDateFromOffset(i, dates); switch (i % 2) { case 1: f.State = (State)((states[i / 2] & 0xF0) >> 4); break; case 0: f.State = (State)((states[i / 2] & 0x0F)); break; } f.Name = FeatList[i]; allFeats.Add(f); } }
private void stateComboBox_SelectedIndexChanged(object sender, EventArgs e) { Feat f = featListBox.SelectedItem as Feat; f.State = (State)stateComboBox.SelectedItem; }
public Feats( byte[] dates, byte[] states ) { allFeats = new List<Feat>( 96 ); for( int i = 0; i < 96; i++ ) { Feat f = new Feat(); f.Date = StupidDate.GetDateFromOffset( i, dates ); switch( i % 2 ) { case 1: f.State = (State)((states[i / 2] & 0xF0) >> 4); break; case 0: f.State = (State)((states[i / 2] & 0x0F)); break; } f.Name = FeatList[i]; allFeats.Add( f ); } }