UNPKG

@0xcap/loot-table

Version:

A simple loot table implementation in TypeScript.

14 lines (11 loc) 279 B
import { v5 as uuid } from "uuid"; export default class LootItem<T> { readonly id: string; item: T; dropRate: number; constructor(item: T, dropRate: number) { this.item = item; this.dropRate = dropRate; this.id = uuid(JSON.stringify(item), uuid.URL); } }