コード例 #1
0
 // static Random random;
 public AblCodeGenerator(StoryData story)
 {
     // random = new Random();
     _typeIdToTraitsRels = new Hashtable(); //maps entity type id's to HashSet<String> => name mappings for traits
     _story = story;
     _goalNames = new Hashtable();
     _plotPointTypeNames = new Hashtable();
     _interactivityDaemonNames = new List<string>();
     _tw = new IndentingWriter();
 }
コード例 #2
0
        public static void writeToFile(IndentingWriter contents, string path)
        {
            try
            {
                // create a writer and open the file
                TextWriter tw = new StreamWriter(path);

                // write a line of text to the file
                tw.Write(contents.ToString());

                // close the stream
                tw.Close();
            }
            catch (Exception e)
            {
                throw new Exception("Error writing generated ABL code: " + e.Message);
            }
        }
コード例 #3
0
ファイル: Utilities.cs プロジェクト: gitter-badger/WideRuled2
        public static void writeToFile(IndentingWriter contents, string path)
        {
            try
            {
                // create a writer and open the file
                TextWriter tw = new StreamWriter(path);

                // write a line of text to the file
                tw.Write(contents.ToString());

                // close the stream
                tw.Close();
            }
            catch (Exception e)
            {
                throw new Exception("Error writing generated ABL code: " + e.Message);
            }
        }