public override void OnDisable() { base.OnDisable(); Units.Clear(); UnitsSense.Clear(); TypedSenseUnits.Clear(); }
public void Clear() { Simulation.Clear(); NPCs.Clear(); Units.Clear(); Invalidate(); }
public void Rollback() { if (backupUnitMap is not null) { UnitMap = backupUnitMap; } if (backupAssemblyMap is not null) { AssemblyMap = backupAssemblyMap; } Units.Clear(); if (backupUnits is null) { return; } for (var i = 0; i < backupUnits.Count; i++) { Units.Add(backupUnits[i]); } compiler = oldCompiler; }
public void DeleteFormation() { foreach (var unit in Units) { Destroy(unit.gameObject); } Units.Clear(); }
//Methods public void ClearList() { FoodPlanItems.Clear(); Ingredients.Clear(); Recipes.Clear(); ShoppingListItems.Clear(); Units.Clear(); UnitTranslations.Clear(); EvaluateMaxIDs(); }
/// <summary> /// Removes all potentially loaded data. /// </summary> public void Unload() { Info = new ScenarioInfo(); Factions.Clear(); Units.Clear(); Areas.Clear(); Connections.Clear(); Items.Clear(); Weapons.Clear(); }
public override void SetDefault() { _nextUnitInx = 0; foreach (var unit in Units) { unit.Restart(); } Units.Clear(); base.SetDefault(); }
public void LoadUnit(int limit, int offset) { var data = UnitServices.GetListWithPagePaging(ContentSearch, offset, limit); if (data != null) { Units = new ObservableCollection <Unit>(data); } else { Units?.Clear(); } }
protected override void Complete(bool failed) { if (failed) { UnitMap = backupUnitMap; AssemblyMap = backupAssemblyMap; Units.Clear(); for (var i = 0; i < backupUnits.Count; i++) { Units.Add(backupUnits[i]); } } }
/// <summary> /// Sets this cargo's fake size to its size (or zero if cargo size can't be seen) and clears the actual population and units. /// Used for fog of war. /// </summary> public void SetFakeSize(bool canSeeCargoSize) { if (canSeeCargoSize && fakeSize == null) { fakeSize = Size; } else if (!canSeeCargoSize) { fakeSize = 0; } Population.Clear(); Units.Clear(); }
public void Clear() { foreach (var item in Units) { item.DetectionMgr.Remove(this, SelfBaseUnit); } Units.Clear(); UnitsEnemy.Clear(); UnitsAlly.Clear(); UnitsSelf.Clear(); for (int i = 0; i < ColliderResults.Length; i++) { ColliderResults[i] = null; } }
public override void LoadSave(object obj) { TransportUnitsServiceSave save = obj as TransportUnitsServiceSave; if (save != null && save.units != null) { Units.Clear(); foreach (var kvp in save.units) { Units.Add(kvp.Key, new TransportUnitInfo(kvp.Value)); } IsLoaded = true; } else { LoadDefaults(); } }
public void UpdateUnits(int numUnits) { Units.Clear(); for (int i = 0; i < numUnits; i++) { string[] inputs = Console.ReadLine().Split(' '); var newUnit = new Unit ( new Point ( int.Parse(inputs[0]), //x int.Parse(inputs[1]) //y ), (EntityOwner)int.Parse(inputs[2]), //owner (UnitType)int.Parse(inputs[3]), //unitType int.Parse(inputs[4]) //health ); Units.Add(newUnit); } }
//Формирует выпадающие списки для фильтров по параметрам public void MakeFilters() { Tasks.Clear(); Units.Clear(); CalcParamTypes.Clear(); DataTypes.Clear(); SuperProcesses.Clear(); foreach (var par in Params.Values) { var ap = par.ArchiveParam; var fp = ap.FirstParam; Tasks.Add(fp.Task ?? ""); Units.Add(ap.Units ?? ""); CalcParamTypes.Add(fp.CalcParamType.ToRussian() ?? ""); SuperProcesses.Add(ap.SuperProcess.ToRussian() ?? ""); DataTypes.Add(ap.DataType.ToRussian()); } if (Book.Forms.ContainsKey(ReporterCommand.FilterParams)) { ((FormFiltersParams)Book.Forms[ReporterCommand.FilterParams]).MakeFiltersLists(); } }
public void LoadViewModel(string username, string bookFilename) { Book book = VTrainerModule.Default.BookController.GetBook(username, bookFilename); this.BookFilename = bookFilename; this.BookImageFilePath = Path.Combine(VTrainerModule.Default.RootPath, VTrainerModule.Default.BookPath, bookFilename + ".png"); this.BookCaption = book?.Caption; this.Username = username; this.PercentLearned = book?.PercentLearned ?? 0; Units.Clear(); IEnumerable <Unit> units = VTrainerModule.Default.UnitController.GetUnits(username, bookFilename); if (units == null) { return; } foreach (Unit unit in units) { LearningBookPageUnitItemViewModel vm = new LearningBookPageUnitItemViewModel(); vm.LoadViewModel(unit, OnUnitIsActiveChanged); Units.Add(vm); } }
public override void Destroy() { World.Clear(); Units.Clear(); }
protected virtual void ClearNavigationProperties() { Units.Clear(); }
public void Clear() { Units.Clear(); UpdateBenchCount(); }
public void LoadFromCVSFile() { if (File == null) { return; } //string fileData = System.IO.File.ReadAllText(FileName); string[] lines = File.text.Split("\n"[0]); Columns.Clear(); Columns.AddRange((lines[0].Trim()).Split(Separeator[0])); Units.Clear(); Units.AddRange((lines[1].Trim()).Split(Separeator[0])); NodeName = File.name; Relative = false; //TODO fill in when we have a buffer already... //if (BufferValid == true) // return; //Reload everything. Data.Clear(); double tsmin = double.PositiveInfinity, tsmax = 0; for (int i = 2; i < lines.Length; i++) { string[] Values = (lines[i].Trim()).Split(Separeator[0]); DataPoint NewData = new DataPoint(); NewData.Timestamp = double.Parse(Values[0]); print(Values); NewData.Values = new double[Values.Length - 1]; for (int c = 1; c < Values.Length; c++) { // Debug.Log (data); // Debug.Log (data.Values[c]); // Debug.Log (Values [c]); NewData.Values[c - 1] = double.Parse(Values [c]); } Data.Add(NewData); //Save min and max. if (NewData.Timestamp > tsmax) { tsmax = NewData.Timestamp; } if (NewData.Timestamp < tsmin) { tsmin = NewData.Timestamp; } } StartTime = tsmin; StopTime = tsmax; BufferValid = true; }
// save function public void ReadSaveFile() { Units.Clear(); Buildings.Clear(); StreamReader unit = new StreamReader("Local_Unit_Save.txt"); StreamReader build = new StreamReader("Local_Buildings_Save.txt"); while (!unit.EndOfStream) { string line = unit.ReadLine(); if (line.Contains("{U}")) { string remaining = line.Split(';')[1]; string[] arr = remaining.Split(','); int xp = int.Parse(arr[0]); int yp = int.Parse(arr[1]); int h = int.Parse(arr[2]); int s = int.Parse(arr[3]); int a = int.Parse(arr[4]); int ar = int.Parse(arr[5]); int f = int.Parse(arr[6]); units.Add(new RangedUnit(xp, yp, h, s, a, ar, f, "U")); } else { string remaining = line.Split(';')[1]; string[] arr = remaining.Split(','); int x = int.Parse(arr[0]); int y = int.Parse(arr[1]); int h = int.Parse(arr[2]); int s = int.Parse(arr[3]); int a = int.Parse(arr[4]); int ar = int.Parse(arr[5]); int f = int.Parse(arr[6]); units.Add(new MeleeUnit(x, y, h, s, a, f, "M")); } } while (!build.EndOfStream) { string line = build.ReadLine(); if (line.Contains("{F}")) { string remaining = line.Split(';')[1]; string[] arr = remaining.Split(','); int x = int.Parse(arr[0]); int y = int.Parse(arr[1]); int h = int.Parse(arr[2]); int f = int.Parse(arr[3]); building.Add(new FactoryBuilding(x, y, h, f, "F")); } else { string remaining = line.Split(';')[1]; string[] arr = remaining.Split(','); int x = int.Parse(arr[0]); int y = int.Parse(arr[1]); int h = int.Parse(arr[2]); int f = int.Parse(arr[3]); building.Add(new FactoryBuilding(x, y, h, f, "R")); } } }
private void RefreshUnits() { Units.Clear(); Units.AddRange(_salesReportUnits.Where(x => x.OrderInTakeDate >= StartDate && x.OrderInTakeDate <= FinishDate)); }
public override void LoadDefaults() { Units.Clear(); IsLoaded = true; }
public void clearAll() { SubjNo.Clear(); DescTitle.Clear(); Units.Clear(); }