   [.net] Datastructures for turn based strategy game.....
  Hey Folks,I am sorta new to development and .net and currently working on creating a turn based strategy game using Silverlight and C# as a hobby project. So far I have a a hex map up and running, internally its an array of Hex objects, which render to the canvas as individual polygons. I have now started thinking about implementing players and units into the game and I am having some trouble figuring out what data structures to use for this. Each game will have a hex map composed of individual hexagons (polygon object in silverlight) that serve as the game tiles. Each game will have 2 or more players that align themselves with one of the two races in game, and then have 1 or more units when they start. During the game they can capture bases and earn credits, which in turn allows them to produce more / different units.My thinking is that I need to maintain an in memory list of all players and all the units that belong to them as well as the location of that unit (in terms of grid location so I can easily look it up in the array of hex's). Should i maintain one master list of it all? Or just have a player object which has a list of units and the units themselves have information on their grid location? That would seem to be the logical way, but then when the player clicks a hexagon (to select his unit) I would need to some how relate that hex with the player and the particular unit on it....Sorry if this sounds a bit noobish, I am new to all this so go easy on me :)   
  Perhaps this thread would be better in the "For Beginners" forum. Can some admin move it there?Thanks.   ;  There are lots of data structures to address lots of different problems.  I would advise clearly identifying your problem and then choosing a data structure to address that problem.  When I choose data structures I generally consider two primary things: performance and convenience.  Typically a certain amount of performance is dictated or implied by the specification -- your game may need to run above a given frame rate, the AI may need to make a move in less than a second etc.  Other performance constraints may only be identified by prototyping and profiling.  Chances are if you are working on a little hobby game than performance is not going to be a big worry (at first anyway).Convenience is about doing what needs to be done and doing it easily.  For example you may need to identify a unit based on a mouse click or find all the units associated with a player.  Think about the questions you need to ask  your data structure (even make a list if you feel like it) and think about how it will answer them.  Object hierarchies are fine though in my experience they tend to introduce artificially strong relationships.  Relational structures are also fine.  I have been really impressed with LINQ of late and I have been using more and more dumb lists and inline queries in place of more complicated structures like Dictionaries and Stacks.Hope some of my rambling helps in some way.   