mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-05-22 05:34:36 +00:00
26 lines
511 B
C#
26 lines
511 B
C#
using WeaveLoader.API;
|
|
|
|
namespace WeaveLoader.API.Loot;
|
|
|
|
public interface ILootFunction
|
|
{
|
|
void Apply(ref LootDrop drop, Random random);
|
|
}
|
|
|
|
public sealed class SetCountLootFunction : ILootFunction
|
|
{
|
|
private readonly int _count;
|
|
|
|
public SetCountLootFunction(int count)
|
|
{
|
|
_count = count;
|
|
}
|
|
|
|
public void Apply(ref LootDrop drop, Random random)
|
|
{
|
|
drop = drop with { Count = _count };
|
|
}
|
|
}
|
|
|
|
public readonly record struct LootDrop(Identifier ItemId, int Count, int Aux);
|