probably should keep the class, I don't think theres a type in gameEntity, though there is one in StarSystemEntity, I would also be a little more paranoid about checking certain things like the planet assignment to be sure that the planet and the TG are in the same star system, the contact to see if it is actually in the contact list,etc , but that does look good.
more efficient. (looking up values in dictionaries instead of looping)
You're doing string compares though, still efficiency isn't that important for the front end.
easier to read. (imo anyway)
As a personal preference I'd rather have a switch than the else ifs, but thats very minor.
lastly, I pushed a bugfix to this file before you grabbed it, so that might be a problem with merging your version and mine, here is the section in question:
SystemLocationListType Type = SystemLocationListType.Count;
if (loop == 0)
{
newIndex = PlaceIndex;
Type = SystemLocationListType.Planets;
#warning special case zero here, if another SystemLocationListType is made to be loop = 0, then Planets here will have to change.
}
else
{
newIndex = PlaceIndex - SystemLocationListIndices[loop-1];
Type = SystemLocationListTypes[loop - 1];
}
/// <summary>
/// Which type is this?
/// </summary>
switch (Type)