using System.Collections; using System.Collections.Frozen; using System.Collections.Generic; using AYellowpaper.SerializedCollections; using BITKit; using Project.B.Item; using UnityEngine; namespace Net.Project.B.Loot { public class ScriptableLoot : ScriptableObject,IScriptableLoot { [SerializeField] private int id; [SerializeField] private int seed; [SerializeReference, SubclassSelector] internal IReference lootName; [SerializeReference, SubclassSelector] internal IWorldLootType lootType; [SerializeField] internal SerializedDictionary itemWeights; public int Id => id; public int Seed => seed; public string Name => lootName?.Value; public IReadOnlyDictionary ItemWeights => itemWeights.ToFrozenDictionary(x=>x.Key.Id,x=>x.Value); public IWorldLootType LootType => lootType; } }