diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs index d20f4a4..8c3158c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectInventory.cs | |||
@@ -61,25 +61,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
61 | if (!m_publicInventory.ContainsKey(privateItem.ItemID)) | 61 | if (!m_publicInventory.ContainsKey(privateItem.ItemID)) |
62 | m_publicInventory.Add(privateItem.ItemID, new InventoryItem(m_rootScene, privateItem)); | 62 | m_publicInventory.Add(privateItem.ItemID, new InventoryItem(m_rootScene, privateItem)); |
63 | } | 63 | } |
64 | 64 | ||
65 | #region IDictionary<UUID, IInventoryItem> implementation | 65 | #region IDictionary<UUID, IInventoryItem> implementation |
66 | public void Add (UUID key, IInventoryItem value) | 66 | public void Add (UUID key, IInventoryItem value) |
67 | { | 67 | { |
68 | m_publicInventory.Add(key, value); | 68 | m_publicInventory.Add(key, value); |
69 | m_privateInventory.Add(key, InventoryItem.FromInterface(value).ToTaskInventoryItem()); | 69 | m_privateInventory.Add(key, InventoryItem.FromInterface(value).ToTaskInventoryItem()); |
70 | } | 70 | } |
71 | 71 | ||
72 | public bool ContainsKey (UUID key) | 72 | public bool ContainsKey (UUID key) |
73 | { | 73 | { |
74 | return m_privateInventory.ContainsKey(key); | 74 | return m_privateInventory.ContainsKey(key); |
75 | } | 75 | } |
76 | 76 | ||
77 | public bool Remove (UUID key) | 77 | public bool Remove (UUID key) |
78 | { | 78 | { |
79 | m_publicInventory.Remove(key); | 79 | m_publicInventory.Remove(key); |
80 | return m_privateInventory.Remove(key); | 80 | return m_privateInventory.Remove(key); |
81 | } | 81 | } |
82 | 82 | ||
83 | public bool TryGetValue (UUID key, out IInventoryItem value) | 83 | public bool TryGetValue (UUID key, out IInventoryItem value) |
84 | { | 84 | { |
85 | value = null; | 85 | value = null; |
@@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
89 | { | 89 | { |
90 | // wasn't found in the public inventory | 90 | // wasn't found in the public inventory |
91 | TaskInventoryItem privateItem; | 91 | TaskInventoryItem privateItem; |
92 | 92 | ||
93 | result = m_privateInventory.TryGetValue(key, out privateItem); | 93 | result = m_privateInventory.TryGetValue(key, out privateItem); |
94 | if (result) | 94 | if (result) |
95 | { | 95 | { |
@@ -98,16 +98,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
98 | } | 98 | } |
99 | } else | 99 | } else |
100 | return true; | 100 | return true; |
101 | 101 | ||
102 | return result; | 102 | return result; |
103 | } | 103 | } |
104 | 104 | ||
105 | public ICollection<UUID> Keys { | 105 | public ICollection<UUID> Keys { |
106 | get { | 106 | get { |
107 | return m_privateInventory.Keys; | 107 | return m_privateInventory.Keys; |
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | public ICollection<IInventoryItem> Values { | 111 | public ICollection<IInventoryItem> Values { |
112 | get { | 112 | get { |
113 | SynchronizeDictionaries(); | 113 | SynchronizeDictionaries(); |
@@ -139,41 +139,41 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
139 | { | 139 | { |
140 | Add(item.Key, item.Value); | 140 | Add(item.Key, item.Value); |
141 | } | 141 | } |
142 | 142 | ||
143 | public void Clear () | 143 | public void Clear () |
144 | { | 144 | { |
145 | m_publicInventory.Clear(); | 145 | m_publicInventory.Clear(); |
146 | m_privateInventory.Clear(); | 146 | m_privateInventory.Clear(); |
147 | } | 147 | } |
148 | 148 | ||
149 | public bool Contains (KeyValuePair<UUID, IInventoryItem> item) | 149 | public bool Contains (KeyValuePair<UUID, IInventoryItem> item) |
150 | { | 150 | { |
151 | return m_privateInventory.ContainsKey(item.Key); | 151 | return m_privateInventory.ContainsKey(item.Key); |
152 | } | 152 | } |
153 | 153 | ||
154 | public void CopyTo (KeyValuePair<UUID, IInventoryItem>[] array, int arrayIndex) | 154 | public void CopyTo (KeyValuePair<UUID, IInventoryItem>[] array, int arrayIndex) |
155 | { | 155 | { |
156 | throw new NotImplementedException(); | 156 | throw new NotImplementedException(); |
157 | } | 157 | } |
158 | 158 | ||
159 | public bool Remove (KeyValuePair<UUID, IInventoryItem> item) | 159 | public bool Remove (KeyValuePair<UUID, IInventoryItem> item) |
160 | { | 160 | { |
161 | return Remove(item.Key); | 161 | return Remove(item.Key); |
162 | } | 162 | } |
163 | 163 | ||
164 | public int Count { | 164 | public int Count { |
165 | get { | 165 | get { |
166 | return m_privateInventory.Count; | 166 | return m_privateInventory.Count; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | public bool IsReadOnly { | 170 | public bool IsReadOnly { |
171 | get { | 171 | get { |
172 | return false; | 172 | return false; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | #endregion | 175 | #endregion |
176 | 176 | ||
177 | #region Explicit implementations | 177 | #region Explicit implementations |
178 | IInventoryItem System.Collections.Generic.IDictionary<UUID, IInventoryItem>.this[UUID key] | 178 | IInventoryItem System.Collections.Generic.IDictionary<UUID, IInventoryItem>.this[UUID key] |
179 | { | 179 | { |
@@ -189,13 +189,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
189 | m_privateInventory[key] = InventoryItem.FromInterface(value).ToTaskInventoryItem(); | 189 | m_privateInventory[key] = InventoryItem.FromInterface(value).ToTaskInventoryItem(); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<UUID, IInventoryItem>>.CopyTo(System.Collections.Generic.KeyValuePair<UUID,IInventoryItem>[] array, int offset) | 193 | void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<UUID, IInventoryItem>>.CopyTo(System.Collections.Generic.KeyValuePair<UUID,IInventoryItem>[] array, int offset) |
194 | { | 194 | { |
195 | throw new NotImplementedException(); | 195 | throw new NotImplementedException(); |
196 | } | 196 | } |
197 | #endregion | 197 | #endregion |
198 | 198 | ||
199 | public IInventoryItem this[string name] | 199 | public IInventoryItem this[string name] |
200 | { | 200 | { |
201 | get { | 201 | get { |
@@ -204,7 +204,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule.Object | |||
204 | { | 204 | { |
205 | if (!m_publicInventory.ContainsKey(i.ItemID)) | 205 | if (!m_publicInventory.ContainsKey(i.ItemID)) |
206 | m_publicInventory.Add(i.ItemID, new InventoryItem(m_rootScene, i)); | 206 | m_publicInventory.Add(i.ItemID, new InventoryItem(m_rootScene, i)); |
207 | 207 | ||
208 | return m_publicInventory[i.ItemID]; | 208 | return m_publicInventory[i.ItemID]; |
209 | } | 209 | } |
210 | throw new KeyNotFoundException(); | 210 | throw new KeyNotFoundException(); |