Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        private void AddObjectRef(RoomObject obj)
        {
            string id = GetItemID(obj);

            if (RoomItemRefs.ContainsKey(id))
            {
                return;
            }
            RoomItemRefs.Add(id, obj);
            DesignItems.Add(id, new DesignTimeProperties());
        }
Ejemplo n.º 3
0
        private void AddCharacterRef(Character c)
        {
            string id = GetItemID(c);

            if (RoomItemRefs.ContainsKey(id))
            {
                return;
            }
            RoomItemRefs.Add(id, c);
            DesignItems.Add(id, new DesignTimeProperties());
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }