/// <summary> /// Load: initializing Constructor from an xml node. /// </summary> /// <param name="node">A <see cref="BattleStepTarget"/> XmlNode from a Nova save file (xml document). </param> public BattleStepMovement(XmlNode node) : base(node) { XmlNode subnode = node.FirstChild; while (subnode != null) { try { switch (subnode.Name.ToLower()) { case "stackkey": StackKey = long.Parse(subnode.FirstChild.Value, System.Globalization.NumberStyles.HexNumber); break; case "point": Position = new NovaPoint(subnode); break; } } catch (Exception e) { Report.Error("Error loading Battle Step - Movement : " + e.Message); } subnode = subnode.NextSibling; } }
/// <summary> /// Initializing constructor from a NovaPoint. /// </summary> /// <param name="p">The initial position as a <see cref="NovaPoint"/>.</param> public NovaPoint(NovaPoint p) { X = p.X; Y = p.Y; }
/// <summary> /// This method adjusts the X and Y values of this Point to the sum of the X and Y values of this Point and p. /// </summary> /// <param name="p">An offset to be applied to this point.</param> public void Offset(NovaPoint p) { this.X += p.X; this.Y += p.Y; }