public bool RemoveLoot(AbsLoot loot) { Type type = loot.GetType(); if (dictionary.ContainsKey(type)) { dictionary [type] = dictionary [type] - 1; --totalCount; return(true); } return(false); }
public void PutLoot(AbsLoot loot) { Type type = loot.GetType(); if (dictionary.ContainsKey(type)) { dictionary [type] = dictionary [type] + 1; } else { dictionary.Add(type, 1); } ++totalCount; Debug.Log(totalCount + " loots"); Debug.Log(dictionary); }
public int GetLootCount(AbsLoot loot) { Type type = loot.GetType(); return(dictionary.ContainsKey(type) ? dictionary [type] : 0); }