Skip to content

Commit 864f792

Browse files
committed
uwu
1 parent 92af4ce commit 864f792

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

EXILED/Exiled.API/Features/Player.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,16 @@ public void Broadcast(ushort duration, string message, global::Broadcast.Broadca
23192319
public void AddAmmo(AmmoType ammoType, ushort amount) =>
23202320
Inventory.ServerAddAmmo(ammoType.GetItemType(), amount);
23212321

2322+
/// <summary>
2323+
/// Adds the amount of a specified <see cref="AmmoType">ammo type</see> to player's inventory.
2324+
/// </summary>
2325+
/// <param name="ammoBag">A dictionary of <see cref="AmmoType">ammo types</see> that will be added.</param>
2326+
public void AddAmmo(Dictionary<AmmoType, ushort> ammoBag)
2327+
{
2328+
foreach (KeyValuePair<AmmoType, ushort> kvp in ammoBag)
2329+
AddAmmo(kvp.Key, kvp.Value);
2330+
}
2331+
23222332
/// <summary>
23232333
/// Adds the amount of a weapon's <see cref="AmmoType">ammo type</see> to the player's inventory.
23242334
/// </summary>
@@ -2338,6 +2348,16 @@ public void SetAmmo(AmmoType ammoType, ushort amount)
23382348
Inventory.ServerSetAmmo(itemType, amount);
23392349
}
23402350

2351+
/// <summary>
2352+
/// Sets the amount of a specified <see cref="AmmoType">ammo type</see> to player's inventory.
2353+
/// </summary>
2354+
/// <param name="ammoBag">A dictionary of <see cref="AmmoType">ammo types</see> that will be added.</param>
2355+
public void SetAmmo(Dictionary<AmmoType, ushort> ammoBag)
2356+
{
2357+
foreach (KeyValuePair<AmmoType, ushort> kvp in ammoBag)
2358+
SetAmmo(kvp.Key, kvp.Value);
2359+
}
2360+
23412361
/// <summary>
23422362
/// Gets the ammo count of a specified <see cref="AmmoType">ammo type</see> in a player's inventory.
23432363
/// </summary>

0 commit comments

Comments
 (0)