public void WriteXml(System.Xml.XmlWriter w, DateTime?Date) { w.WriteStartElement("Resources"); if (Date.HasValue) { w.WriteAttributeString("Date", Date.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } w.WriteElementString("Wood", Wood.ToString()); w.WriteElementString("Clay", Clay.ToString()); w.WriteElementString("Iron", Iron.ToString()); w.WriteEndElement(); }
public override string ToString() { if (Set) { return(string.Format("W{0}, C{1}, I{2}", Wood.ToString("#,0"), Clay.ToString("#,0"), Iron.ToString("#,0"))); } return("Nothing"); }