private void buttonOK_Click(object sender, System.EventArgs e) { m_um = 0; for (int i = 0; i < checkedListBox.CheckedItems.Count; i++) { UnitType ut = ((UnitTypeWrapper)checkedListBox.CheckedItems[i]).ut; m_um = (UnitMask)(((uint)m_um) | (uint)(1 << (int)ut)); } }
public CaTypeUnitTypesForm(UnitMask um) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // m_um = um; InitUnitTypesListBox(); }
private void InitUnitTypesListBox() { UnitMask um = UnitMask.kumMobileUnits | UnitMask.kumAndy | UnitMask.kumFox; uint umT = 1; for (int i = 0; i < 32; i++) { if (((uint)um & umT) != 0) { UnitType ut = (UnitType)i; listBoxUnitTypes.Items.Add(new UnitTypeWrapper(ut)); } umT <<= 1; } }
private CaTypeUnitTypes(SerializationInfo info, StreamingContext context) { try { m_um = 0; OldUnitType[] aut; aut = (OldUnitType[])info.GetValue("m_aut", typeof(OldUnitType[])); for (int i = 0; i < aut.Length; i++) { UnitMask umT = s_aumFromOldUnitType[(int)aut[i]]; m_um = (UnitMask)(((int)m_um) | (int)umT); } } catch (SerializationException) { m_um = (UnitMask)info.GetValue("m_um", typeof(UnitMask)); } m_fInit = true; }
StringCollection GetUnitTypeNames() { StringCollection strc = new StringCollection(); UnitMask um = UnitMask.kumNewAll; uint umT = 1; for (int i = 0; i < 32; i++) { if (((uint)um & umT) != 0) { UnitType ut = (UnitType)i; strc.Add(Helper.GetDisplayName(typeof(UnitType), ut.ToString())); } umT <<= 1; } return(strc); }
private void buttonNone_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumNone; InitUnitTypesListBox(); }
private void buttonBuilders_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumFactories; InitUnitTypesListBox(); }
private void buttonStructures_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumStructures; InitUnitTypesListBox(); }
private void buttonMobileUnits_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumMobileUnits; InitUnitTypesListBox(); }
public CaTypeUnitTypes(UnitMask um) { m_um = um; }
public CaTypeUnitTypes() { m_um = UnitMask.kumNone; }
private void buttonInfantry_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumInfantry; InitUnitTypesListBox(); }
private void buttonVehicles_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumVehicles; InitUnitTypesListBox(); }
private void buttonAll_Click(object sender, System.EventArgs e) { m_um = UnitMask.kumAll; InitUnitTypesListBox(); }