Esempio n. 1
0
 public DefRoom(Main M, Rooms_El_4 currRoom, EL_4 El4Ref)
 {
     this.currRoom = currRoom;
     this.EL4Ref = El4Ref;
     this.M = M;
     InitializeComponent();
 }
Esempio n. 2
0
 private void LoadRoom(Rooms_El_4 r)
 {
     RoomName.Text = r.RoomName;
     Panel[] counts = new Panel[3] { ContCount, LightCount, PowAmp };
     Panel[] amps = new Panel[3] { ContAmp, LightAmp, PowAmperage };
     foreach (Installation_El_4 inst in r.ListOfInstallations)
     {
         InstallationItem it = inst.Item;
         int type = (int)inst.Item.Type;
         int sec = Main.Stats.Items.FindAll(x => (int)x.Type == type).IndexOf(it);
         if (type == 2)
         {
             PowAmpCollection.SetItemChecked(sec, true);
             sec = PowAmpList.Items.IndexOf(it.Name);
         }
         (counts[type].Controls[sec] as NumericUpDown).Value++;
         if ((counts[type].Controls[sec] as NumericUpDown).Value == 1)
             (amps[type].Controls[sec] as ComboBox).SelectedIndex = inst.TypeProtector;
     }
 }