public bool Equals(MyAmmoAssignment other) { if (other == null) { return(false); } return(GetHashCode() == other.GetHashCode()); }
/// <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); }
/// <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); } }
/// <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)); } }
public bool Equals(MyAmmoAssignment other) { if (other == null) return false; return GetHashCode() == other.GetHashCode(); }
public void WeaponShot(MySmallShipGunBase gun, MyAmmoAssignment ammoAssignment) { //Electricity -= MySmallShipConstants.WEAPON_ELECTRICITY_CONSUMPTION; }