Example #1
0
        protected void LoadScript(String fileName)
        {
            log.DebugFormat("loading script from file {0}", fileName);
            var r     = new StreamReader(fileName);
            var turns = new List <LTGTurn>();

            for (var line = r.ReadLine(); line != null; line = r.ReadLine())
            {
                if (line.StartsWith("#") || line.Trim().Length == 0) // ignore comments and blank lines
                {
                    continue;
                }

                turns.Add(LTGTurn.Parse(line));
                log.DebugFormat("[{0}] {1}", turns.Count - 1, turns.Last());
            }

            _script = turns.ToArray();
        }
Example #2
0
 public virtual void ExecuteTurn(LTGTurn turn)
 {
     _oStream.Write(turn.ToCommandString());
     _oStream.Flush();
 }