public override void Build() { var files = GetFilesWithoutDirectories(Data.FullSearchPath); for (int i = 0; i < files.Count; i++) { var item = files[i]; if (EditorUtility.DisplayCancelableProgressBar(string.Format("Packing... [{0}/{1}]", i, files.Count), item, i * 1f / files.Count)) { EditorUtility.ClearProgressBar(); break; } string bundleName = GetABNameWithDirectoryAndFile(Data.FinalDirectory, item); if (!IsContainInPackedAssets(item)) { AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = bundleName; build.assetNames = new string[] { item }; Builds.Add(build); AddToPackedAssets(item); } if (!AllAssets.ContainsKey(item)) { AllAssets.Add(item, bundleName); } } }
public override void Build() { var files = GetFilesWithoutDirectories(Config.FullSearchPath); for (int i = 0; i < files.Count; i++) { var item = files[i]; if (EditorUtility.DisplayCancelableProgressBar(string.Format("Packing... [{0}/{1}]", i, files.Count), item, i * 1f / files.Count)) { EditorUtility.ClearProgressBar(); break; } Tuple <string, string> bundleName = GetABNamePath(DLCItem, item); if (!IsContainInPackedAssets(item)) { AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = bundleName.Item1; build.assetNames = new string[] { item }; Builds.Add(build); AddToPackedAssets(item); } AddToAllAssets(item, bundleName); AddToAllBundles(bundleName); } }
public async Task LoadAsync() { // 35 var lookup = await _lookupBuildsService.GetBuildsAsync(); Builds.Clear(); foreach (var item in lookup) { Builds.Add(item); } }
public static LoadSaveResult LoadBuildData(string bstr) { #if !DEBUG try #endif { // upgrade: bstr = bstr.Replace("\"b_hp\"", "\"hp\""); bstr = bstr.Replace("\"b_atk\"", "\"atk\""); bstr = bstr.Replace("\"b_def\"", "\"def\""); bstr = bstr.Replace("\"b_spd\"", "\"spd\""); bstr = bstr.Replace("\"b_crate\"", "\"critical_rate\""); bstr = bstr.Replace("\"b_cdmg\"", "\"critical_damage\""); bstr = bstr.Replace("\"b_acc\"", "\"accuracy\""); bstr = bstr.Replace("\"b_res\"", "\"res\""); var bs = JsonConvert.DeserializeObject <List <Build> >(bstr); foreach (var b in bs.OrderBy(b => b.Priority)) { Builds.Add(b); } foreach (var b in Builds.Where(b => b.Type == BuildType.Link)) { b.LinkBuild = Program.Builds.FirstOrDefault(bu => bu.ID == b.LinkId); } } #if !DEBUG catch (Exception e) { File.WriteAllText("error_build.txt", e.ToString()); throw new InvalidOperationException("Error occurred loading Build JSON.\r\n" + e.GetType() + "\r\nInformation is saved to error_build.txt"); } #endif if (Program.Builds.Count > 0 && (Program.Data?.Monsters == null)) { // backup, just in case string destFile = Path.Combine("", string.Format("{0}.backup{1}", "builds", ".json")); int num = 2; while (File.Exists(destFile)) { destFile = Path.Combine("", string.Format("{0}.backup{1}{2}", "builds", num, ".json")); num++; } File.Copy("builds.json", destFile); return(LoadSaveResult.Failure); } SanitizeBuilds(); return(LoadSaveResult.Success); }
void objope() { if (MarksAvaiInitCount > MarksAvaiInitMax) { if (ClearPoint.X != -1) //オブジェクト削除 { int id = GetNearistRoad(ClearPoint, false)[0]; for (int i = 0; i < Roads.Count; i++) { if (Roads[i].GetObjectID() == id) { Roads.Remove(Roads[i]); break; } } } foreach (int i in RoadMarkersNumber) // 道を追加 { if (RoadMarkersAvailable[i]) { List <int> l = GetNearistRoad(RoadMarkers[i], true); if (l.Count != 0) //Roadが一つ以上ある場合。 //-1、つまり、近くにオブジェクトがない場合はコネクトのidはなしでOK! { foreach (BaseRoadClass o in Roads) { if (l.Contains(o.GetObjectID())) { o.Add(Roads.Count); } } Roads.Add(new BaseRoadClass(Roads.Count, RoadMarkers[i], "Road", l)); } RoadMarkersAvailable[i] = false; } } foreach (KeyValuePair <int, Point> kv in BuildPoint) //建物追加 { Builds.Add(new BaseBuildClass(Builds.Count, kv.Value, "Build")); BuildPoint = new Dictionary <int, Point>(); } MarksAvaiInitCount = 0; } }
private void InitBuilds(TfsBuildMonitorManager manager) { Builds.Clear(); foreach (var buildDef in manager.BuildDefinitions) { var t = buildDef.First(); Builds.Add(new BuildDefinitionViewModel() { Id = t.id, Name = t.definition.name, LastRequested = DateTime.Parse(t.queueTime), LastRequestedBy = t.requestedFor.displayName, UserImage = t.requestedFor.imageUrl, Status = t.result, LastChange = t.LastChange }); } Refresh(); }
private void LoadBuilds() { string url = @"https://raw.githubusercontent.com/AndrewSotnikovEng/TabsHolder/master/place_holder.xml"; ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; XmlSerializer serializer = new XmlSerializer(typeof(BuildHolder)); XmlTextReader reader = new XmlTextReader(url); BuildHolder b = (BuildHolder)serializer.Deserialize(reader); reader.Close(); foreach (var item in b.Builds) { Builds.Add(item); } }
private void EnqueueBuild(object arg) { var user = SelectedUser.User; var branch = SelectedBranch.Branch; var definition = SelectedDefinition.Definition; var build = new Build { LastChangedTime = DateTime.Now, QueueTime = DateTime.Now, Definition = definition, BranchName = branch.Name, RequestedBy = user, Status = BuildStatus.Pending, Id = (++_idCounter).ToString() }; _mainViewModel.AddBuild(build); Builds.Add(new BuildViewModel(build)); }
protected async Task BuildLoad() { if (projects != null) { foreach (var proj in projects) { var bs = await buildclient.GetBuildsAsync(proj.Id); foreach (var b in bs) { RemoveBuilds(b); RemoveBuildRelease(b); Builds.Add(b); BuildRelease br = GetBuild(proj, b); BuildRelease.Add(br); } } } }
public static void Read() { Builds.Clear(); Games.Clear(); RecentFiles.Clear(); Settings.Clear(); Hotkeys.Clear(); AdditionalSettings.Clear(); FavouriteTextureFolders.Clear(); var root = ReadSettingsFile(); if (root == null) { return; } var settings = root.Children.FirstOrDefault(x => x.Name == "Settings"); if (settings != null) { foreach (var key in settings.GetPropertyKeys()) { Settings.Add(new Setting { Key = key, Value = settings[key] }); } } var recents = root.Children.FirstOrDefault(x => x.Name == "RecentFiles"); if (recents != null) { foreach (var key in recents.GetPropertyKeys()) { int i; if (int.TryParse(key, out i)) { RecentFiles.Add(new RecentFile { Location = recents[key], Order = i }); } } } var games = root.Children.Where(x => x.Name == "Game"); foreach (var game in games) { var g = new Game(); g.Read(game); Games.Add(g); } var builds = root.Children.Where(x => x.Name == "Build"); foreach (var build in builds) { var b = new Build(); b.Read(build); Builds.Add(b); } var hotkeys = root.Children.FirstOrDefault(x => x.Name == "Hotkeys"); if (hotkeys != null) { foreach (var key in hotkeys.GetPropertyKeys()) { var spl = key.Split(':'); Hotkeys.Add(new Hotkey { ID = spl[0], HotkeyString = hotkeys[key] }); } } Serialise.DeserialiseSettings(Settings.ToDictionary(x => x.Key, x => x.Value)); Sledge.Settings.Hotkeys.SetupHotkeys(Hotkeys); var additionalSettings = root.Children.FirstOrDefault(x => x.Name == "AdditionalSettings"); if (additionalSettings != null) { foreach (var child in additionalSettings.Children) { if (child.Children.Count > 0) { AdditionalSettings.Add(child.Name, child.Children[0]); } } } var favTextures = root.Children.FirstOrDefault(x => x.Name == "FavouriteTextures"); if (favTextures != null && favTextures.Children.Any()) { try { var ft = GenericStructure.Deserialise <List <FavouriteTextureFolder> >(favTextures.Children[0]); if (ft != null) { FavouriteTextureFolders.AddRange(ft); } FixFavouriteNames(FavouriteTextureFolders); } catch { // Nope } } if (!File.Exists(SettingsFile)) { Write(); } }
private void ExecuteAddCommand() { Builds.Add(new BuildConfigure_ViewModel()); SelectedBuild = Builds.LastOrDefault(); }
public MesgBuildsPair(List <int> data, ORom.Build build) { Data = data; Builds.Add(build); }
// this should only run once on startup private void SetDefaultBuildDirectory() { // load up the builds from Builds.xml using (XmlReader reader = XmlReader.Create($@"Xml\{XmlBaseFolder}\Builds.xml")) { reader.MoveToContent(); if (reader.Name != "Builds") { return; } while (reader.Read()) { if (reader.IsStartElement()) { string type = reader["type"]; string link = reader["link"]; string pre = reader["pre"]; try { if (reader.Read()) { if (string.IsNullOrEmpty(pre)) { BuildPatchNotesByBuildNumber.Add(Convert.ToInt32(reader.Value), new Tuple <string, string>(type, link)); } else { var previousBuild = BuildPatchNotesByBuildNumber[Convert.ToInt32(pre)]; BuildPatchNotesByBuildNumber.Add(Convert.ToInt32(reader.Value), new Tuple <string, string>(previousBuild.Item1, previousBuild.Item2)); } } } catch (FormatException ex) { throw new ParseXmlException($"Could not convert to Int32: {pre} | {reader.Value}", ex); } } } } foreach (var build in BuildPatchNotesByBuildNumber) { int buildNumber = build.Key; if (!Directory.Exists($@"Xml\{XmlBaseFolder}\{buildNumber}")) { throw new ParseXmlException($"Could not find required Build Folder: Xml\\{XmlBaseFolder}\\{buildNumber}"); } else { Builds.Add(buildNumber); } } Builds = Builds.OrderByDescending(x => x).ToList(); EarliestHeroesBuild = Builds[Builds.Count - 1]; LatestHeroesBuild = SelectedBuild = Builds[0]; }
/// <summary> /// 打包共享的资源 /// </summary> protected static void BuildSharedAssets(DLCItem dlcItem) { Dictionary <string, List <string> > bundles = new Dictionary <string, List <string> >(); foreach (var item in AllDependencies) { var name = "None"; var assetPath = item.Key; if (!assetPath.EndsWith(".cs", StringComparison.CurrentCulture) && !assetPath.EndsWith(".js", StringComparison.CurrentCulture)) { if (IsContainInPackedAssets(assetPath)) { continue; } //打包共享的Sahder资源,制作成一个完整的单独包 if (assetPath.EndsWith(".shader", StringComparison.CurrentCulture)) { name = BaseConstMgr.BN_Shader; } else { //如果依赖的资源小于2个,则跳过 if (item.Value.Count <= 1) { continue; } //打包Native共享资源 if (dlcItem.IsNative) { name = BaseConstMgr.BN_Shared; } //打包其他DLC资源,打成散包 else { name = BaseConstMgr.BN_Shared + "/" + GetABNameWithFullPath(Path.GetDirectoryName(assetPath)); } } //添加到Bundles List <string> list = null; if (!bundles.TryGetValue(name, out list)) { list = new List <string>(); bundles.Add(name, list); } if (!list.Contains(assetPath)) { list.Add(assetPath); AddToPackedAssets(assetPath); } } } //放入打包容器 foreach (var item in bundles) { AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = item.Key;// + "_" + item.Value.Count; build.assetNames = item.Value.ToArray(); Builds.Add(build); } }
public void Initialize() // TODO: rename to initialize { // users var johnDoe = Users.CreateJohnDoe(); var janeDoe = Users.CreateJaneDoe(); Users.Add(johnDoe); Users.Add(janeDoe); // Vcs roots var vcsGit = VcsRoots.CreateVcsRestClientGit(); var vcs1 = VcsRoots.CreateVcs(Guid.NewGuid()); VcsRoots.Add(vcsGit); VcsRoots.Add(vcs1); // Vcs root instances var bitbucketInstance = VcsRootInstances.CreateVcsInstance(vcsGit); VcsRootInstances.Add(bitbucketInstance); // AgentPools var defaultPool = BuildAgentPools.CreateDefaultPool(); BuildAgentPools.Add(defaultPool); // Agents var enabledAgent = BuildAgents.CreateEnabledAgent(johnDoe, johnDoe, defaultPool); var disabledAgent = BuildAgents.CreateDisabledAgent(janeDoe, defaultPool); BuildAgents.Add(enabledAgent); BuildAgents.Add(disabledAgent); var rootProject = Projects.CreateRootProject(); var clientProject = Projects.CreateRestClientProject(rootProject); var cliProject = Projects.CreateTeamCityCliProject(rootProject); var project1 = Projects.CreateProject(Guid.NewGuid(), rootProject); Projects.Add(rootProject); Projects.Add(clientProject); Projects.Add(cliProject); Projects.Add(project1); var restType = BuildTypes.CreateBuildTypeRestClient(clientProject); var cliType = BuildTypes.CreateBuildTypeTeamCityCli(cliProject); BuildTypes.Add(restType); BuildTypes.Add(cliType); var buildOk = Builds.CreateOKBuild(restType, johnDoe, enabledAgent, bitbucketInstance); var buildFailed = Builds.CreateFailedBuild(restType, johnDoe, enabledAgent, bitbucketInstance); var buildQueued = Builds.CreateQueuedBuild(restType, johnDoe); var buildCanceled = Builds.CreateCancelledBuild(restType, johnDoe); var buildRunning = Builds.CreateRunningBuild(restType, johnDoe); Builds.Add(buildOk); Builds.Add(buildFailed); Builds.Add(buildQueued); Builds.Add(buildCanceled); Builds.Add(buildRunning); // Build queue BuildQueue.AddRange(Builds.All().Items.Where(build => build.State == "queued")); var change1 = Changes.CreateChange("1", "Initial commit.", DateTime.UtcNow.AddDays(-7), johnDoe, bitbucketInstance); var change2 = Changes.CreateChange("2", "Add TeamCity fake data.", DateTime.UtcNow.AddDays(-6), johnDoe, bitbucketInstance); var change3 = Changes.CreateChange("3", "Add Changes unit tests.", DateTime.UtcNow.AddDays(-4), johnDoe, bitbucketInstance); Changes.Add(change1); Changes.Add(change2); Changes.Add(change3); var inv = Investigations.CreateInvetigation("1", janeDoe); Investigations.Add(inv); }
/// <summary> /// 打包共享的资源 /// </summary> protected static void BuildSharedAssets(DLCItem dlc) { //打散包的时候需要用到 Dictionary <string, List <string> > dicAssets = new Dictionary <string, List <string> >(); List <string> assets = new List <string>(); foreach (var item in AllDependencies) { var assetPath = item.Key; if (!assetPath.EndsWith(".cs", StringComparison.CurrentCulture) && !assetPath.EndsWith(".js", StringComparison.CurrentCulture)) { //bundle里的资源不包含到共享包 if (assetPath.Contains(SysConst.Dir_Bundles)) { continue; } if (IsContainInPackedAssets(assetPath)) { continue; } //如果依赖的资源小于2个,则跳过 if (item.Value.Count <= 1) { continue; } string dirPath = Path.GetDirectoryName(assetPath); if (!dicAssets.ContainsKey(dirPath)) { dicAssets.Add(dirPath, new List <string>()); } dicAssets[dirPath].Add(assetPath); assets.Add(assetPath); AddToPackedAssets(assetPath); } } if (dicAssets.Count > 0 && assets.Count > 0) { //离散共享包 if (DLCConfig.IsDiscreteShared) { foreach (var item in dicAssets) { Tuple <string, string> bundleName = GetABNameSharedDiscrete(dlc, item.Key); AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = bundleName.Item1; build.assetNames = item.Value.ToArray(); Builds.Add(build); AddToAllBundles(bundleName, true); } } //非离散共享包 else { Tuple <string, string> bundleName = GetABNameShared(dlc); AssetBundleBuild build = new AssetBundleBuild(); build.assetBundleName = bundleName.Item1; build.assetNames = assets.ToArray(); Builds.Add(build); AddToAllBundles(bundleName, true); } } }