public Rally(long start_time, int setNr) { this.start_time = start_time; // These new position objects are in "click"-order service_pos = new Position(); reception_pos = new Position(); set_pos = new Position(); start_pos = new Position(); takeoff_pos = new Position(); defence_pos = new Position(); approach_pos = new Position(); // Set the default values kill = true; drop = false; smash = true; bigPoint = false; finalized = false; defaultRallyDevelopment = true; timeout = false; correspondingSetNr = setNr; }
private XmlNode newPositionNode(Position position, string label) { XmlAttribute x, y, zeitpunkt; XmlNode newposition_label = xmlDoc.CreateElement(label); zeitpunkt = xmlDoc.CreateAttribute("Zeitpunkt"); zeitpunkt.InnerText = position.Absolute_PositionTime.ToString(); newposition_label.Attributes.Append(zeitpunkt); XmlNode position_element = xmlDoc.CreateElement("Position"); x = xmlDoc.CreateAttribute("X"); x.InnerText = position.WorldX.ToString(); position_element.Attributes.Append(x); y = xmlDoc.CreateAttribute("Y"); y.InnerText = position.WorldY.ToString(); position_element.Attributes.Append(y); newposition_label.AppendChild(position_element); return newposition_label; }
private Position getPosition(XmlNode xmlposition) { Position position = new Position(); position.PositionTime = Convert.ToInt64(xmlposition.SelectSingleNode("@ZeitpunktRelativ").InnerText); XmlNode coordinates = xmlposition.SelectSingleNode("Position"); position.ImageX = Convert.ToInt32(coordinates.SelectSingleNode("@IX").InnerText); position.ImageY = Convert.ToInt32(coordinates.SelectSingleNode("@IY").InnerText); position.WorldX = Convert.ToInt32(coordinates.SelectSingleNode("@WX").InnerText); position.WorldY = Convert.ToInt32(coordinates.SelectSingleNode("@WY").InnerText); return position; }