public string[] GetFileText() { List <string> text = new List <string>(); text.Add(DefaultDesignOperation.ToString()); text.Add("START"); List <ResfileAaIdentifier> positions = _operations.Keys.ToList(); positions.Sort((a, b) => a.ChainIndex != b.ChainIndex ? a.ChainIndex.CompareTo(b.ChainIndex) : a.AaIndex.CompareTo(b.AaIndex)); int chainIndex = 0; char chain = DefaultChain; foreach (ResfileAaIdentifier position in positions) { ResfileAaOperation operation = _operations[position]; while (chainIndex < position.ChainIndex) { chainIndex++; chain = PdbQuick.GetNextChainId(chain); } string letters = operation.Letters.Aggregate("", (a, b) => a + b); string line = String.Format("{0} {1} {2} {3}", position.AaIndex + 1, chain, operation.Operation, letters); text.Add(line); } return(text.ToArray()); }
public void SetDesignOperation(ResfileDesignOperation operation, int chainIndex, int aaIndex, IEnumerable <char> letters = null) { ResfileAaIdentifier aaIdentifier = new ResfileAaIdentifier(chainIndex, aaIndex); ResfileAaOperation aaOperation = new ResfileAaOperation(operation, letters); _operations[aaIdentifier] = aaOperation; }