public void LoadDetachmentTemplates() { FileStream fsDetachment = null; allDetachments = new ModelClasses.Detachments(); allDetachments.Clear(); try { XmlSerializer detachmentSerializer = new XmlSerializer(typeof(ModelClasses.Detachments)); fsDetachment = new FileStream(detachmentsFile, FileMode.Open); allDetachments = (ModelClasses.Detachments)detachmentSerializer.Deserialize(fsDetachment); fsDetachment.Close(); } catch (Exception excp) { if (fsDetachment != null) { fsDetachment.Dispose(); } } }
public String GetSummary(bool includeProfile, bool includeWargear) { StringBuilder sbSummary = new StringBuilder(); if (IsStrictMatchPlay) { sbSummary.Append("Matched Game Armylist - Fraktion "); sbSummary.Append(ArmyFactionForMatchedPlay.Name); sbSummary.Append(" "); } else { sbSummary.Append("Battleforged Armylist - ohne Fraktionszwang "); } sbSummary.Append("\'" + Name + "\'"); sbSummary.AppendLine(); sbSummary.AppendLine(new String('-', sbSummary.Length)); sbSummary.Append("Matched Game Points: "); sbSummary.Append(CurrentPoints); if (DoCheckPointLimt) { sbSummary.Append(" / "); sbSummary.Append(PointLimit); } sbSummary.Append(" Powerlevel: "); sbSummary.Append(CurrentPowerLevel); if (DoCheckPowerlevel) { sbSummary.Append(" / "); sbSummary.Append(Powerlevel); } sbSummary.Append(" Commandpoints: "); sbSummary.Append(CurrentCommandPoints); sbSummary.AppendLine(); sbSummary.AppendLine(); if (Detachments != null && Detachments.Any()) { sbSummary.Append(Detachments.Count); sbSummary.Append(" Detachments enthalten:"); sbSummary.AppendLine(); foreach (ModelClasses.Detachment detach in Detachments) { sbSummary.AppendLine("- " + detach.ToString()); } } sbSummary.AppendLine(); if (Detachments != null && Detachments.Any()) { foreach (ModelClasses.Detachment detach in Detachments) { sbSummary.AppendLine(detach.GetSummary(includeProfile, includeWargear)); } } sbSummary.AppendLine(); sbSummary.AppendLine(new string('-', 80)); sbSummary.AppendLine("Created with Scriptorum Exercitus. (c)2017, www.ibbreiter.de\\scriptorum"); return(sbSummary.ToString()); }
public ForceOrgChart() { Detachments = new Detachments(); BaseCommandPoints = 3; }