public static string GenerateSystemSuffix(UTinySystem system, UTinyPlatform forPlatform = UTinyPlatform.HTML5) { if (forPlatform != UTinyPlatform.HTML5) { throw new ArgumentException("Platform not supported"); } return("}"); }
public static string GenerateSystemIteratorSuffix(UTinySystem system, UTinyPlatform forPlatform = UTinyPlatform.HTML5) { if (forPlatform != UTinyPlatform.HTML5) { throw new ArgumentException("Platform not supported"); } return("});" + Environment.NewLine); }
public static string GenerateSystemPrefix(UTinySystem system, UTinyPlatform forPlatform = UTinyPlatform.HTML5) { if (forPlatform != UTinyPlatform.HTML5) { throw new ArgumentException("Platform not supported"); } return("function (sched, world) {"); }
public static string GenerateSystemIteratorPrefix(UTinySystem system, UTinyPlatform forPlatform = UTinyPlatform.HTML5) { if (forPlatform != UTinyPlatform.HTML5) { throw new ArgumentException("Platform not supported"); } return(system.Components.Count == 0 ? "world.forEachEntity([], function (entity) {" : $"world.forEachEntity([{string.Join(", ", system.Components.Select(p => GetJsTypeName(p.Dereference(system.Registry))).ToArray())}], \nfunction (entity, {string.Join(", ", system.Components.Select(p => p.Name.ToLower()).ToArray())}) {{"); }
public static string GetBuildDirectory(UTinyProject project, UTinyPlatform platform, UTinyBuildConfiguration configuration) { return(Path.Combine("UTinyExport", project.Name, platform.ToString(), configuration.ToString())); }