示例#1
0
 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;
            }
        }
示例#4
0
        public CaTypeUnitTypesForm(UnitMask um)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            m_um = um;

            InitUnitTypesListBox();
        }
示例#5
0
 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;
 }
示例#6
0
        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);
        }
示例#7
0
 private void buttonNone_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumNone;
     InitUnitTypesListBox();
 }
示例#8
0
 private void buttonBuilders_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumFactories;
     InitUnitTypesListBox();
 }
示例#9
0
 private void buttonStructures_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumStructures;
     InitUnitTypesListBox();
 }
示例#10
0
 private void buttonMobileUnits_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumMobileUnits;
     InitUnitTypesListBox();
 }
 private void buttonBuilders_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumFactories;
     InitUnitTypesListBox();
 }
示例#12
0
		public CaTypeUnitTypes(UnitMask um) {
			m_um = um;
		}
示例#13
0
 public CaTypeUnitTypes(UnitMask um)
 {
     m_um = um;
 }
示例#14
0
 public CaTypeUnitTypes()
 {
     m_um = UnitMask.kumNone;
 }
 private void buttonMobileUnits_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumMobileUnits;
     InitUnitTypesListBox();
 }
 private void buttonInfantry_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumInfantry;
     InitUnitTypesListBox();
 }
示例#17
0
		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;
		}
 private void buttonVehicles_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumVehicles;
     InitUnitTypesListBox();
 }
示例#19
0
		public CaTypeUnitTypes() {
			m_um = UnitMask.kumNone;
		}
示例#20
0
 private void buttonInfantry_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumInfantry;
     InitUnitTypesListBox();
 }
 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));
     }
 }
 private void buttonAll_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumAll;
     InitUnitTypesListBox();
 }