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

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

            m_um = um;

            InitUnitTypesListBox();
        }
コード例 #3
0
        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();
 }
コード例 #11
0
 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;
 }
コード例 #15
0
 private void buttonMobileUnits_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumMobileUnits;
     InitUnitTypesListBox();
 }
コード例 #16
0
 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;
		}
コード例 #18
0
 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();
 }
コード例 #21
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));
     }
 }
コード例 #22
0
 private void buttonAll_Click(object sender, System.EventArgs e)
 {
     m_um = UnitMask.kumAll;
     InitUnitTypesListBox();
 }