From db8fc350b2bffda63d27797bfe7ae4afb4af327e Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 4 Feb 2011 15:40:12 +0100 Subject: Initial commit of NW4RTools. Supports BRRES reading for: Model Bytecode, Model Nodes, Model Vertex Data, and incomplete Materials. Writing is completely unimplemented so far. --- NW4RTools/Util/IOrderedDictionary.cs | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 NW4RTools/Util/IOrderedDictionary.cs (limited to 'NW4RTools/Util/IOrderedDictionary.cs') diff --git a/NW4RTools/Util/IOrderedDictionary.cs b/NW4RTools/Util/IOrderedDictionary.cs new file mode 100644 index 0000000..a574c7c --- /dev/null +++ b/NW4RTools/Util/IOrderedDictionary.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; + +// From http://www.codeproject.com/KB/recipes/GenericOrderedDictionary.aspx + +namespace NW4RTools.Util +{ + /// + /// Represents a generic collection of key/value pairs that are ordered independently of the key and value. + /// + /// The type of the keys in the dictionary + /// The type of the values in the dictionary + public interface IOrderedDictionary : IOrderedDictionary, IDictionary + { + /// + /// Adds an entry with the specified key and value into the IOrderedDictionary<TKey,TValue> collection with the lowest available index. + /// + /// The key of the entry to add. + /// The value of the entry to add. + /// The index of the newly added entry + /// + /// You can also use the property to add new elements by setting the value of a key that does not exist in the IOrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the IOrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + /// An element with the same key already exists in the IOrderedDictionary<TKey,TValue> + /// The IOrderedDictionary<TKey,TValue> is read-only.
+ /// -or-
+ /// The IOrderedDictionary<TKey,TValue> has a fized size.
+ new int Add(TKey key, TValue value); + + /// + /// Inserts a new entry into the IOrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. + /// + /// The zero-based index at which the element should be inserted. + /// The key of the entry to add. + /// The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. + /// is less than 0.
+ /// -or-
+ /// is greater than .
+ /// An element with the same key already exists in the IOrderedDictionary<TKey,TValue>. + /// The IOrderedDictionary<TKey,TValue> is read-only.
+ /// -or-
+ /// The IOrderedDictionary<TKey,TValue> has a fized size.
+ void Insert(int index, TKey key, TValue value); + + /// + /// Gets or sets the value at the specified index. + /// + /// The zero-based index of the value to get or set. + /// The value of the item at the specified index. + /// is less than 0.
+ /// -or-
+ /// is equal to or greater than .
+ new TValue this[int index] + { + get; + set; + } + } +} -- cgit v1.2.3