private void RemoveObjectRef(RoomObject obj) { string id = GetItemID(obj); RoomItemRefs.Remove(id); DesignItems.Remove(id); }
private void RemoveCharacterRef(Character c) { string id = GetItemID(c); RoomItemRefs.Remove(id); DesignItems.Remove(id); }
private void UpdateCharacterRef(Character c, string oldID) { if (!RoomItemRefs.ContainsKey(oldID)) { return; } string newID = GetItemID(c); // If the new key is also present that means we are swapping two items if (RoomItemRefs.ContainsKey(newID)) { var char2 = RoomItemRefs[newID]; RoomItemRefs.Remove(newID); RoomItemRefs.Remove(oldID); RoomItemRefs.Add(newID, c); RoomItemRefs.Add(oldID, char2); // We must keep DesignTimeProperties! var char1Item = DesignItems[oldID]; var char2Item = DesignItems[newID]; DesignItems.Remove(newID); DesignItems.Remove(oldID); DesignItems.Add(newID, char1Item); DesignItems.Add(oldID, char2Item); } else { RoomItemRefs.Remove(oldID); RoomItemRefs.Add(newID, c); // We must keep DesignTimeProperties! DesignItems.Add(newID, DesignItems[oldID]); DesignItems.Remove(oldID); } }
private void UpdateObjectRef(RoomObject obj, string oldID) { if (!RoomItemRefs.ContainsKey(oldID)) { return; } string newID = GetItemID(obj); RoomItemRefs.Remove(oldID); RoomItemRefs.Add(newID, obj); // We must keep DesignTimeProperties! DesignItems.Add(newID, DesignItems[oldID]); DesignItems.Remove(oldID); }
private void UpdateCharacterRef(Character c, string oldID) { if (!RoomItemRefs.ContainsKey(oldID)) { return; } string newID = GetItemID(c); RoomItemRefs.Remove(oldID); RoomItemRefs.Add(newID, c); // We must keep DesignTimeProperties! DesignItems.Add(newID, DesignItems[oldID]); DesignItems.Remove(oldID); }