コード例 #1
0
        internal Story SubstoryRight(string p)
        {
            bool  Found = false;
            Story ret   = new Story();

            foreach (StoryLine l in Lines)
            {
                if (!Found)
                {
                    StoryLine TempLine = new StoryLine();
                    foreach (CTextpart tp in l.TextParts)
                    {
                        if (!Found)
                        {
                            int index = tp.text.IndexOf(p);
                            if (index >= 0)
                            {
                                Found = true;
                                TempLine.AddTextParts(new CTextpart(tp.text.Substring(index), tp.font));
                            }
                        }
                        else
                        {
                            TempLine.AddTextParts(tp);
                        }
                    }
                    ret.AddLine(TempLine);
                }
                else
                {
                    ret.AddLine(l);
                }
            }
            return(ret);
        }
コード例 #2
0
        internal Story SubstoryLeft(string p)
        {
            Story ret = new Story();

            foreach (StoryLine l in Lines)
            {
                StoryLine TempLine = new StoryLine();
                foreach (CTextpart tp in l.TextParts)
                {
                    int index = tp.text.IndexOf(p);
                    if (index >= 0)
                    {
                        // aggiungo parte prima del separtore
                        if (index > 0)
                        {
                            TempLine.AddTextParts(new CTextpart(tp.text.Substring(0, index), tp.font));
                        }

                        if (TempLine.TextParts.Count > 0)
                        {
                            ret.AddLine(TempLine);
                        }
                        return(ret);
                    }
                    else
                    {
                        TempLine.AddTextParts(tp);
                    }
                }
                ret.AddLine(TempLine);
            }
            return(ret);
        }
コード例 #3
0
 public Story(string text, Font font)
 {
     this.Lines = new List <StoryLine>();
     TempLine   = new StoryLine();
     TempLine.AddTextParts(new CTextpart(text, font));
     this.Lines.Add(TempLine);
     TempLine = new StoryLine();
 }
コード例 #4
0
 public Story(string sID)
 {
     this.ID    = sID;
     this.Lines = new List <StoryLine>();
     TempLine   = new StoryLine();
 }
コード例 #5
0
 public Story()
 {
     this.ID    = "";
     this.Lines = new List <StoryLine>();
     TempLine   = new StoryLine();
 }
コード例 #6
0
 private void AddLine(StoryLine TempLine)
 {
     Lines.Add(TempLine);
 }
コード例 #7
0
 internal void AddLineEnd()
 {
     Lines.Add(TempLine);
     TempLine = new StoryLine();
 }
コード例 #8
0
 public Story(StoryLine CurLine)
 {
     this.Lines = new List <StoryLine>();
     this.Lines.Add(CurLine);
     TempLine = new StoryLine();
 }