public void GoPoemBegining() { PoemLine curLine = this.CurrentLine; if (systemAccumulation != null) { if (curLine == null) { curLine = systemAccumulation.GetFirstLine(); SetOneLine(curLine); } else { Poem curPoem = curLine.ParentPoem; bool isFirstLine = curPoem.IsFirstLine(curLine); if (!isFirstLine) { SetOneLine(curPoem.GetFirstLine()); } } } }
public void SetCurrentLine(Poem poem) { PoemLine line = poem.GetFirstLine(); if (CurrentLine != line) { SetOneLine(line); } }
internal PoemLineIdentifier GetID() { PoemLineIdentifier result = new PoemLineIdentifier(); result.LineString = this.Line; PoemPart curPoemPart = this.ParentPoemPart; Poem curPoem = this.ParentPoem; result.PoemName = curPoem.Name; result.PoemFirstLine = curPoem.GetFirstLine().Line; PoemLinesCollection collLines = null; if (curPoemPart != null) { collLines = curPoemPart.Lines; result.PoemPartName = curPoemPart.Name; result.PoemPartFirstLine = curPoemPart.GetFirstLine().Line; result.PoemPartIndex = curPoem.Parts.IndexOf(curPoemPart); } else { collLines = curPoem.Lines; } result.LineIndex = collLines.IndexOf(this); SABlockPart curBlockPart = curPoem.ParentBlockPart; SABlock curBlock = curPoem.ParentBlock; result.BlockName = curBlock.Name; result.BlockIndex = curBlock.ParentSA.Blocks.IndexOf(curBlock); PoemCollection collPoems = null; if (curBlockPart != null) { collPoems = curBlockPart.Poems; result.BlockPartName = curBlockPart.Name; result.BlockPartFirstLine = curBlockPart.GetFirstLine().Line; result.BlockPartIndex = curBlock.Parts.IndexOf(curBlockPart); } else { collPoems = curBlock.Poems; } result.PoemIndex = collPoems.IndexOf(curPoem); return(result); }
public void GetRandomPoem(SABlockPart blockPart) { PoemLine result = null; if (blockPart != null) { int poemCount = blockPart.PoemCount; int randomPoemIndex = CommonOperations.rnd.Next(poemCount); Poem randomPoem = blockPart.GetPoemByIndex(randomPoemIndex); result = randomPoem.GetFirstLine(); } SetOneLine(result); }
public void GetRandomPoem() { PoemLine result = null; if (systemAccumulation != null) { int poemCount = systemAccumulation.PoemCount; int randomPoemIndex = CommonOperations.rnd.Next(poemCount); Poem randomPoem = systemAccumulation.GetPoemByIndex(randomPoemIndex); result = randomPoem.GetFirstLine(); } SetOneLine(result); }
private PoemLine GenerateNextPoem(PoemLine currentLine, bool forward) { Poem nextPoem = this.mySAIterator.GetNextPoem(currentLine.ParentPoem, forward); return(nextPoem.GetFirstLine()); }