internal void BuyGoods(int id) { int val; if (GoodsBuyData.TryGetValue(id, out val)) { GoodsBuyData[id] = val + 1; } else { GoodsBuyData.TryAdd(id, 1); } }
internal void AddGoodData(int goodId, int number) { int val; if (GoodsBuyData.TryGetValue(goodId, out val)) { GoodsBuyData[goodId] = val + number; } else { GoodsBuyData.TryAdd(goodId, number); } }