Exemple #1
0
        protected void LoadSystem(string[] files)
        {
            // var fileName = ;

            var file = files.FirstOrDefault(x => x.EndsWith("data.json"));

            if (!string.IsNullOrEmpty(file))
            {
                // var fileContents = Encoding.UTF8.GetString(ReadAllBytes(file));

                var jsonParser = new SystemParser(file, _fileLoadHelper, targetEngine);

                jsonParser.CalculateSteps();

                while (jsonParser.completed == false)
                {
                    jsonParser.NextStep();
                }
            }
        }
Exemple #2
0
        private void LoadSystem(Dictionary <string, byte[]> files)
        {
            var fileName = "data.json";

            if (files.ContainsKey(fileName))
            {
                var fileContents = Encoding.UTF8.GetString(files[fileName]);

//                AddParser(new SystemParser(fileContents, targetEngine));
                var jsonParser = new SystemParser(targetEngine, fileContents);

                jsonParser.CalculateSteps();

                while (jsonParser.completed == false)
                {
                    jsonParser.NextStep();
                }
            }
//            else
//            {
//                throw new Exception("Can't find 'data.json' file");
//            }
        }