// IGAMESAVE INTERFACE: ------------------------------------------------------------------- public object GetSaveData() { MerchantSaveData data = new MerchantSaveData(); foreach (KeyValuePair <string, MerchantData> item in this.wares) { data.warehouses.Add(item.Value); } return(data); }
public void OnLoad(object generic) { MerchantSaveData saveData = (MerchantSaveData)generic; this.wares = new Dictionary <string, MerchantData>(); for (int i = 0; i < saveData.warehouses.Count; ++i) { MerchantData saveDataItem = saveData.warehouses[i]; string key = MerchantData.GetKey(saveDataItem.merchantID, saveDataItem.itemID); if (this.wares.ContainsKey(key)) { continue; } this.wares.Add(key, saveDataItem); } }