Table of Contents

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

module IAmmoContainerModule

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

int

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

Firearm

MaxAmmo

Gets or sets a max avaible ammo count in magazine.

public abstract int MaxAmmo { get; set; }

Property Value

int

Methods

Fill()

Fills current Ammo to MaxAmmo.

public void Fill()

Get(IAmmoContainerModule)

Gets wrapper to an InventorySystem.Items.Firearms.Modules.IAmmoContainerModule.

public static Magazine Get(IAmmoContainerModule module)

Parameters

module IAmmoContainerModule

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

delta int

Ammo change value.

useBorders bool

Whether new ammo should be clamped in range of 0 and 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()