Ejemplo n.º 1
0
        private void ParseTemplates()
        {
            ReadLine();
            if (Match("World templates"))
            {
                _jkl.Templates = new Dictionary <string, JKLTemplate>();
                while (true)
                {
                    ReadLine();
                    if (_line == "end")
                    {
                        break;
                    }

                    var name      = _args[0];
                    var basedOn   = _args[1];
                    var numParams = _args.Count - 2;
                    var template  = JKLTemplate.CreateNewBasedOn(basedOn == "none" ? null : _jkl.Templates[basedOn]);
                    for (int i = 0; i < numParams; i++)
                    {
                        var argVal = _args[2 + i].Split('=');
                        template.Parameters[argVal[0]] = argVal[1];
                    }
                    _jkl.Templates.Add(name, template);
                }
            }
        }
Ejemplo n.º 2
0
        public static JKLTemplate CreateNewBasedOn(JKLTemplate baseTemplate)
        {
            var template = new JKLTemplate();

            if (baseTemplate != null)
            {
                template.Parameters = new Dictionary <string, string>(baseTemplate.Parameters);
            }

            return(template);
        }