SMAPI/Mods/ConvenientChests/CategorizeChests/Framework/ChestDataManager.cs

12 lines
406 B
C#
Raw Normal View History

2019-04-10 01:22:10 +08:00
using System.Runtime.CompilerServices;
using StardewValley.Objects;
namespace ConvenientChests.CategorizeChests.Framework
{
class ChestDataManager : IChestDataManager
{
private readonly ConditionalWeakTable<Chest, ChestData> _table = new ConditionalWeakTable<Chest, ChestData>();
public ChestData GetChestData(Chest chest) => _table.GetValue(chest, c => new ChestData(c));
}
}