public static List<Arrow> loadArrowInfo(ContentManager Content) { List<Arrow> list = new List<Arrow>(); XmlDocument doc = new XmlDocument(); doc.Load(@"Data/arrow.dat"); XmlNodeList arrows = doc.SelectNodes("//arrow"); for (int i = 0; i < arrows.Count; i++) { Arrow arrow = new Arrow(); Texture2D texture = Content.Load<Texture2D>(arrows[i].InnerText); arrow.Sprite = new NormalSprite(texture, 0, 0, texture.Width, texture.Height); arrow.Damage = int.Parse(arrows[i].Attributes["damage"].Value); arrow.Speed = float.Parse(arrows[i].Attributes["speed"].Value); arrow.CurSpeed = 1; list.Add(arrow); } return list; }
internal Arrow Clone() { Arrow newObj = new Arrow(); newObj.Sprite = this.Sprite.Clone(); newObj.Speed = this.Speed; newObj.CurSpeed = this._curSpeed; newObj.Damage = this.Damage; return newObj; }