コード例 #1
0
 private MapScriptGroup(ScriptGroup scriptGroup)
 {
     Name          = scriptGroup.Name;
     _scripts      = MapScript.Create(scriptGroup.Scripts);
     IsActive      = scriptGroup.IsActive;
     _isSubroutine = scriptGroup.IsSubroutine;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: MapScriptCollection.cs プロジェクト: wu162/OpenSAGE
        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;
                }
            }
        }