public static BearingObservation Load(XmlReader reader, Dictionary <Observation, string> observers) { BearingObservation shape = new BearingObservation(); LoadPositionalData(shape, reader); shape.Bearing = reader.GetDoubleAttribute("bearing"); observers.Add(shape, reader.GetAttribute("observer")); return(shape); }
public static Shape Load(XmlReader reader, Dictionary <Observation, string> observers, Dictionary <string, UnitShape> unitsById) { Shape shape; switch (reader.LocalName) { case "circle": shape = CircleShape.Load(reader); break; case "line": shape = LineShape.Load(reader); break; case "unit": shape = UnitShape.Load(reader, observers, unitsById); break; case "bearingObservation": shape = BearingObservation.Load(reader, observers); break; case "pointObservation": shape = PointObservation.Load(reader, observers); break; case "waypoint": shape = Waypoint.Load(reader); break; default: throw new System.IO.InvalidDataException("Unknown shape tag: " + reader.LocalName); } reader.Read(); return(shape); }