Ejemplo n.º 1
0
        public string GenerateCode(ScenesCodeCooker scenesCodeCooker, bool isRootNode = true)
        {
            var result = isRootNode ? scenesCodeCooker.SceneCodeTemplate : scenesCodeCooker.FrameCodeTemplate;

            result = result.Replace("<%CLASS_NAME%>", ClassName);
            result = result.Replace("<%SCENE_PATH%>", "\"" + ScenePath + "\"");
            result = result.Replace("<%FIELDS%>", GenerateFields(scenesCodeCooker));
            result = result.Replace("<%INIT_FIELDS%>", GenerateFieldsInitialization(scenesCodeCooker));
            result = result.Replace("<%INNER_CLASSES%>", GenerateInnerClasses(scenesCodeCooker));
            result = result.Replace("<%ANIMATIONS%>", ParsedNode.GenerateAnimations(isRootNode ? "T" : null));
            result = result.Replace("<%IT%>", ParsedNode.GenerateIt());
            result = result.Replace("<%COMMON_BASE%>", GenerateCommonBase());
            return(result);
        }
Ejemplo n.º 2
0
        public string GenerateCode(ScenesCodeCooker scenesCodeCooker, bool isRootNode = true)
        {
            var result = isRootNode ? scenesCodeCooker.SceneCodeTemplate : scenesCodeCooker.FrameCodeTemplate;

            result = result.Replace("<%CLASS_NAME%>", ClassName);
            result = result.Replace("<%WRAPPED_NODE_TYPE_GENERIC_ARGUMENT%>", ParsedNode.TypeFullName);
            result = result.Replace("<%SCENE_PATH%>", "\"" + Path.ChangeExtension(ScenePath, null) + "\"");
            result = result.Replace("<%FIELDS%>", GenerateFields(scenesCodeCooker));
            result = result.Replace("<%INIT_FIELDS%>", GenerateFieldsInitialization(scenesCodeCooker));
            result = result.Replace("<%INNER_CLASSES%>", GenerateInnerClasses(scenesCodeCooker));
            result = result.Replace("<%ANIMATIONS%>", ParsedNode.GenerateAnimations(isRootNode ? "T" : null));
            result = result.Replace("<%IT%>", ParsedNode.GenerateIt());
            result = result.Replace("<%COMMON_BASE%>", GenerateCommonBase());
            result = result.Replace("<%USING%>", GenerateUsingLibraries(result));
            return(result);
        }