示例#1
0
 public FlowType Checkout()
 {
     Random rand = new Random();
     List<VariableItem> curr = new List<VariableItem>();
     int i = rand.Next(9), startChar, startLine;
     curr.Add(this);
     for (; i >= 0; i--)
     {
         startChar = rand.Next(0, 50);
         startLine = rand.Next(1, Form1.MAX_ROWS);
         VariableItem t = new VariableItem(StartChar, startLine, StartChar + rand.Next(1, 10), startLine + rand.Next(1));
         curr.Add(t);
     }
     List<VariableItem> trace = new List<VariableItem>();
     i = rand.Next(10);
     for (; i >= 0; i--)
     {
         startChar = rand.Next(0, 50);
         startLine = rand.Next(1, Form1.MAX_ROWS);
         VariableItem t = new VariableItem(StartChar, startLine, StartChar + rand.Next(1, 10), startLine + rand.Next(1));
         trace.Add(t);
     }
     startChar = rand.Next(0, 50);
     startLine = rand.Next(1, Form1.MAX_ROWS);
     return new FlowType(this, curr, trace);
 }
示例#2
0
 public FlowType(VariableItem original, List<VariableItem> current, List<VariableItem> trace)
 {
     _original = original;
     _trace = trace;
     _current = current;
 }