示例#1
0
        public bool Equals(MyAmmoAssignment other)
        {
            if (other == null)
            {
                return(false);
            }

            return(GetHashCode() == other.GetHashCode());
        }
示例#2
0
        /// <summary>
        /// Returns collection of assignment of ammo objectbuilders
        /// </summary>
        /// <returns></returns>
        public List <MyMwcObjectBuilder_AssignmentOfAmmo> GetObjectBuilder()
        {
            List <MyMwcObjectBuilder_AssignmentOfAmmo> objectBuilders = new List <MyMwcObjectBuilder_AssignmentOfAmmo>();

            foreach (var ammoAssignmentKVP in m_ammoAssignmentCollection)
            {
                MyAmmoAssignment ammoAssignment = ammoAssignmentKVP.Value;
                objectBuilders.Add(new MyMwcObjectBuilder_AssignmentOfAmmo(ammoAssignment.FireKey, ammoAssignment.AmmoGroup, ammoAssignment.AmmoType));
            }
            return(objectBuilders);
        }
示例#3
0
        /// <summary>
        /// Returns ammo type by fire key
        /// </summary>
        /// <param name="key">Fire key</param>
        /// <returns></returns>
        public MyMwcObjectBuilder_SmallShip_Ammo_TypesEnum GetAmmoType(MyMwcObjectBuilder_FireKeyEnum key)
        {
            MyAmmoAssignment ammoAssignment = GetAmmoAssignment(key);

            if (ammoAssignment == null)
            {
                return(0);
            }
            else
            {
                return(ammoAssignment.AmmoType);
            }
        }
示例#4
0
        /// <summary>
        /// Assign ammo group, ammo type to fire key
        /// </summary>
        /// <param name="fireKey">Fire key</param>
        /// <param name="ammoGroup">Ammo group</param>
        /// <param name="ammoType">Ammmo type</param>
        public void AssignAmmo(MyMwcObjectBuilder_FireKeyEnum fireKey, MyMwcObjectBuilder_AmmoGroupEnum ammoGroup, MyMwcObjectBuilder_SmallShip_Ammo_TypesEnum ammoType)
        {
            MyAmmoAssignment ammoAssignment = GetAmmoAssignment(fireKey);

            if (ammoAssignment != null)
            {
                ammoAssignment.AmmoGroup = ammoGroup;
                ammoAssignment.AmmoType  = ammoType;
            }
            else
            {
                m_ammoAssignmentCollection.Add((int)fireKey, new MyAmmoAssignment(fireKey, ammoGroup, ammoType));
            }
        }
示例#5
0
        public bool Equals(MyAmmoAssignment other) 
        {
            if (other == null) return false;

            return GetHashCode() == other.GetHashCode();
        }
示例#6
0
 public void WeaponShot(MySmallShipGunBase gun, MyAmmoAssignment ammoAssignment)
 {
     //Electricity -= MySmallShipConstants.WEAPON_ELECTRICITY_CONSUMPTION;
 }