123456789101112131415161718192021222324252627282930 |
- using System.Collections.Generic;
- namespace GFGGame
- {
- public class StorageDataManager : SingletonBase<StorageDataManager>
- {
- private Dictionary<int, int> _storangeInfoById = new Dictionary<int, int>();
- 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)
- {
- int value = 0;
- _storangeInfoById.TryGetValue(key, out value);
- return value;
- }
- }
- }
|