public ModuleSection(L5KReadStream readings) : base(readings, readings.ModuleTypeSecStart, readings.ModuleTypeSecEnd) { _childrenName = "$NoName"; _modules = new List <Module>();//This separates the content in Modules var moduleIndexes = _content.FindAllIndex(x => x.StartsWith(" " + _initializer) && !x.Contains(_childrenName)); //This section reads each Index that has been found and builds a Module object for each for (var i = 0; i < moduleIndexes.Count; i++) { var index = moduleIndexes[i]; if (i + 1 != moduleIndexes.Count) { var count = moduleIndexes[i + 1] - index; _modules.Add(new Module(_content.GetRange(index, count))); } else { var count = _content.Count - index; _modules.Add(new Module(_content.GetRange(index, count))); } } _needed = new List <Module>(); }
public L5Ksection(L5KReadStream readings, int startSec, int endSec) { _content = new List <string>(); for (int i = startSec; i <= endSec; i++) { _content.Add(readings[i]); } //_content.FindAllIndex(x => x.StartsWith(_initializer));//probably will have to use this in a //child class _projectName = readings.ProjectName; }
public TagSection(L5KReadStream readings) : base(readings, readings.TagSecStart, readings.TagSecEnd) { _needed = new HashSet <Tag>(); _initializer = readings.TagInit; _localTagSection = false; //debbuging //foreach(var line in _content) //{ // Console.WriteLine(line); //} }
public DataTypeSection(L5KReadStream readings) : base(readings, readings.DataTypeSecStart, readings.DataTypeSecEnd) { var datatypeIndexes = _content.FindAllIndex(x => x.StartsWith(" " + _initializer));//probably need to change this _datatypes = new Dictionary <string, int[]>(); for (var i = 0; i < datatypeIndexes.Count; i++) { var index = datatypeIndexes[i]; if (i + 1 != datatypeIndexes.Count) { _datatypes.Add(_GetNameBetweenElements(_content[index], _initializer.Length + 1, ' ') , new int[] { index, datatypeIndexes[i + 1] }); } else { _datatypes.Add(_GetNameBetweenElements(_content[index], _initializer.Length + 1, ' ') , new int[] { index, _content.Count - 1 }); } } _needed = new HashSet <string>(); }
public IntroSection(L5KReadStream readings) : base(readings, readings.BegginingSecStart, readings.BegginingSecEnd) { }
public ControllerSection(L5KReadStream readings) : base(readings, readings.ControllerSecStart, readings.ControllerSecEnd) { _initializer = readings.ControllerInit; _mainController = new Controller(_content); }