   Which collection/container?
  Hello, all. I should start by apologising for what will probably end up being quite a long-winded post, but I think it may in fact help cut down on questions in the long run.OK. A few years ago a friend and I made a pretty wildlife simulator in C++ that makes certain small animals (ants, bugs, etc.) walk around a map along set paths.The program works with a set simulation of ordered paths to which animal models are attached, so that the animals go walkies, with a default separation time between the paths. These paths come in three forms - single paths (play just once), finitely-repeating paths (play a finite number of times), and infinitely-repeating paths (play until England win the World Cup) - but I'll just focus on the first two for now. These set simulations were hardcoded into the program, but I'd like to allow the user to create their own simulation (.sim) files with their selection of single/repeating paths, so I'm currently making an editor to do so. I'd like to use .NET 2.0 - more specifically C# - for this, since I've heard good things about it with regards to tool development.So, I have a group of files, each of which represents the properties of a path that a model can take, for example the filename of the file that actually holds the path coordinates, the name of the path, etc. This is abstracted in a class called PathProperties.These paths can be added to a simulation file in the form of a single path (SinglePathProperties) or a repeating path (RepeatingPathProperties), which are just extended versions of PathProperties, i.e. have the properties of a path plus a few others, e.g. the number of times to repeat. In the simulation file, an index (starting at 1) is added so that the order in which the paths are traversed in the simulation can be controlled.With my editor, I'd like the user to be able to: create a new simulation file by showing them the list of paths (PathProperties) as defined by the path files and letting them add paths as single or repeating ones, and change the order of the paths in the simulation file; and open an existing simulation file and add more paths, remove paths, change their order, etc.I would like to know what collection class to use to store the single and repeating routes within the simulation file, which we'll say is abstracted in a class called SimulationFile. I'd like to use a dynamic array or linked list of some sort, but when reading an existing simulation and changing the order of the paths the index needs to be stored, so maybe I should use some sort of dictionary or something, but that seems a little overkill. What about when the user removes, for example, a repeating path from the middle of the collection of repeating paths? The index needs to be updated.Anyone got any ideas/thoughts? I am using .NET 2.0 and so would prefer suggestions with generic collections (i.e. those found in the System.Collections.Generic namespace) in mind. However, I would welcome any answers in general computer science or C++-family language terms. I guess what I'm asking is kind of analogous to an ordered list box (especially since I will be using one of these to display the single and repeating animal paths to the user).Thanks a lot, and sorry if this is a stupid question!   
  There's no such thing as a stupid question (most of the time at least).  As a matter of fact you took the time to explain your problem and your requirements, which is much appreciated by those reading the post [smile]If this were C++ I'd suggest using a std::set and ordering your paths by index.  That way the set is always sorted, and you prevent yourself from ambiguities by having more than one path with the same index.From my experience C# doesn't have as strong a collections library.  The closest thing I've found is to use a System.Collections.Generic.List object and still have the objects sorted by index.  The only difference is that sorting would have to be performed explicitly as needed (after loading, before saving, etc.) and you wouldn't be able to guarantee the uniqueness of an index.  I haven't spent a whole lot of time studying the new .NET 2.0 collections namespace, so there might be something better out there.   