예제 #1
0
        public static string GenerateYuzuDeserializersForApp()
        {
            AssetCooker.CookForActivePlatform();
            if (!BuildGame())
            {
                return("Can not BuildGame");
            }

            var builder = new SolutionBuilder(
                The.Workspace.ActivePlatform, The.Workspace.CustomSolution);
            int exitCode = builder.Run("--GenerateYuzuDeserializers");

            if (exitCode != 0)
            {
                return($"Application terminated with exit code {exitCode}");
            }
            string app      = builder.GetApplicationPath();
            string assembly = Path.Combine(Path.GetDirectoryName(app), "Serializer.dll");

            if (!File.Exists(assembly))
            {
                Console.WriteLine("{0} doesn't exist", assembly);
                Console.WriteLine(@"Ensure your Application.cs contains following code:
	if (Array.IndexOf(args, ""--GenerateYuzuDeserializers"") >= 0) {
		Lime.Serialization.GenerateDeserializers(""OceanDeserializers.cs"", ""OceanDeserializers"", GetSerializationTypes());
		return;
	}"    );
                return(string.Empty);
            }
            return(null);
            // TODO: write location of generated file
        }
예제 #2
0
파일: BuildGame.cs 프로젝트: klenin/Citrus
 public static string BuildAndRunAction()
 {
     AssetCooker.CookForActivePlatform();
     if (!Actions.BuildGame())
     {
         return("Can not BuildGame");
     }
     return(null);
 }
예제 #3
0
 public static string BuildAndRun(string configuration)
 {
     AssetCooker.CookForActivePlatform();
     if (!BuildGame(The.Workspace.ActivePlatform, The.Workspace.CustomSolution, configuration))
     {
         return("Can not BuildGame");
     }
     The.UI.ScrollLogToEnd();
     RunGame(The.Workspace.ActivePlatform, The.Workspace.CustomSolution, configuration);
     return(null);
 }
예제 #4
0
 public static string RebuildGameAction()
 {
     if (The.UI.AskConfirmation("Are you sure you want to rebuild the game?"))
     {
         CleanupGame();
         AssetCooker.CookForActivePlatform();
         if (!BuildGame())
         {
             return("Can not BuildGame");
         }
     }
     return(null);
 }
예제 #5
0
        public static string BuildAndRunAction()
        {
            AssetCooker.CookForActivePlatform();

            if (!BuildGame())
            {
                return("Can not BuildGame");
            }

            The.UI.ScrollLogToEnd();
            RunGame();
            return(null);
        }
예제 #6
0
        public static string GenerateYuzuDeserializersForApp()
        {
            AssetCooker.CookForActivePlatform();
#if WIN
            if (!BuildGame(Orange.TargetPlatform.Win))
            {
#elif MAC
            if (!BuildGame(Orange.TargetPlatform.Mac))
            {
#endif
                return("Can not BuildGame");
            }
#if WIN
            var builder = new SolutionBuilder(TargetPlatform.Win);
#elif MAC
            var builder = new SolutionBuilder(TargetPlatform.Mac);
#endif
            int exitCode = builder.Run("--GenerateYuzuDeserializers");
            if (exitCode != 0)
            {
                return($"Application terminated with exit code {exitCode}");
            }
            string app      = builder.GetApplicationPath();
            string dir      = System.IO.Path.GetDirectoryName(app);
            string assembly = System.IO.Path.Combine(dir, "Serializer.dll");
            if (!System.IO.File.Exists(assembly))
            {
                Console.WriteLine("{0} doesn't exist", assembly);
                Console.WriteLine(@"Ensure your Application.cs contains following code:
	if (Array.IndexOf(args, ""--GenerateYuzuDeserializers"") >= 0) {
		Lime.Serialization.GenerateDeserializers(""OceanDeserializers.cs"", ""OceanDeserializers"", GetSerializationTypes());
		return;
	}"    );
                return("");
            }
            return(null);
            // TODO: write location of generated file
        }
    }
예제 #7
0
 public static void CookGameAssetsAction()
 {
     AssetCooker.CookForActivePlatform();
 }