using System.Collections.Generic; namespace GFGGame { public class StorageDataManager : SingletonBase { private Dictionary _storangeInfoById = new Dictionary(); public void Clear() { _storangeInfoById.Clear(); } public void InitStorageInfo(int key, int value) { if (!_storangeInfoById.ContainsKey(key)) { _storangeInfoById.Add(key, value); } _storangeInfoById[key] = value; } public int GetStorageValue(int key) { if (!_storangeInfoById.ContainsKey(key)) { return 0; } return _storangeInfoById[key]; } } }