object ISaveable.CaptureState() { var state = new Dictionary <int, DockedItemRecord>(); foreach (var pair in dockedItems) { var record = new DockedItemRecord(); record.itemID = pair.Value.item.GetItemID(); record.number = pair.Value.number; state[pair.Key] = record; } return(state); }
object ISaveable.Save() { var state = new Dictionary <int, DockedItemRecord>(); foreach (var pair in _dockedItems) { if (pair.Value.item == null) { continue; } Debug.Log(pair.Value.item.Name); var record = new DockedItemRecord(); record.itemID = pair.Value.item.ItemID; record.number = pair.Value.number; state[pair.Key] = record; } return(state); }