Class Magazine
- Namespace
- Exiled.API.Features.Items.FirearmModules
- Assembly
- Exiled.API.dll
Basic abstraction of InventorySystem.Items.Firearms.Modules.IAmmoContainerModule.
public abstract class Magazine- Inheritance
- 
      
      Magazine
- Derived
- Inherited Members
- Extension Methods
Constructors
Magazine(IAmmoContainerModule)
Initializes a new instance of the Magazine class.
public Magazine(IAmmoContainerModule module)Parameters
- moduleIAmmoContainerModule
- target InventorySystem.Items.Firearms.Modules.IAmmoContainerModule. 
Properties
Ammo
Gets or sets a count of current ammo in magazine.
public abstract int Ammo { get; set; }Property Value
AmmoContainerModule
Gets an original InventorySystem.Items.Firearms.Modules.IAmmoContainerModule.
public IAmmoContainerModule AmmoContainerModule { get; }Property Value
- IAmmoContainerModule
Firearm
Gets target Firearm assotiated with this magazine.
public abstract Firearm Firearm { get; }Property Value
MaxAmmo
Gets or sets a max avaible ammo count in magazine.
public abstract int MaxAmmo { get; set; }Property Value
Methods
Fill()
public void Fill()Get(IAmmoContainerModule)
Gets wrapper to an InventorySystem.Items.Firearms.Modules.IAmmoContainerModule.
public static Magazine Get(IAmmoContainerModule module)Parameters
- moduleIAmmoContainerModule
- The target InventorySystem.Items.Firearms.Modules.IAmmoContainerModule. 
Returns
- Magazine
- The wrapper for the given InventorySystem.Items.Firearms.Modules.IAmmoContainerModule. 
ModifyAmmo(int, bool)
Modifies stored ammo in magazine.
public int ModifyAmmo(int delta, bool useBorders = true)Parameters
- deltaint
- Ammo change value. 
- useBordersbool
- Whether new ammo should be clamped in range of - 0and MaxAmmo.
Returns
- int
- Resultly changed ammos. 
Remarks
Just a variation of the Ammo setter.
Resync()
Resyncs a related values with a client.
public abstract void Resync()