private MapScriptGroup(ScriptGroup scriptGroup) { Name = scriptGroup.Name; _scripts = MapScript.Create(scriptGroup.Scripts); IsActive = scriptGroup.IsActive; _isSubroutine = scriptGroup.IsSubroutine; }
internal static MapScript[] Create(Script[] scripts) { var result = new MapScript[scripts.Length]; for (var i = 0; i < scripts.Length; i++) { result[i] = new MapScript(scripts[i]); } return(result); }
public MapScriptCollection(ScriptList scriptList) { var scriptGroups = MapScriptGroup.Create(scriptList.ScriptGroups); var scripts = MapScript.Create(scriptList.Scripts); ScriptGroups = scriptGroups; Scripts = scripts; _scriptsByName = new Dictionary <string, MapScript>(); foreach (var script in scripts) { _scriptsByName[script.Name] = script; } foreach (var scriptGroup in scriptGroups) { foreach (var script in scriptGroup.Scripts) { _scriptsByName[script.Name] = script; } } }