예제 #1
0
 public override void OnDisable()
 {
     base.OnDisable();
     Units.Clear();
     UnitsSense.Clear();
     TypedSenseUnits.Clear();
 }
예제 #2
0
 public void Clear()
 {
     Simulation.Clear();
     NPCs.Clear();
     Units.Clear();
     Invalidate();
 }
예제 #3
0
    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();
    }
예제 #5
0
 //Methods
 public void ClearList()
 {
     FoodPlanItems.Clear();
     Ingredients.Clear();
     Recipes.Clear();
     ShoppingListItems.Clear();
     Units.Clear();
     UnitTranslations.Clear();
     EvaluateMaxIDs();
 }
예제 #6
0
 /// <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();
 }
예제 #7
0
        public override void SetDefault()
        {
            _nextUnitInx = 0;

            foreach (var unit in Units)
            {
                unit.Restart();
            }

            Units.Clear();
            base.SetDefault();
        }
예제 #8
0
        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();
            }
        }
예제 #9
0
        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]);
                }
            }
        }
예제 #10
0
        /// <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();
        }
예제 #11
0
 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;
     }
 }
예제 #12
0
        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();
            }
        }
예제 #13
0
    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);
        }
    }
예제 #14
0
 //Формирует выпадающие списки для фильтров по параметрам
 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);
            }
        }
예제 #16
0
 public override void Destroy()
 {
     World.Clear();
     Units.Clear();
 }
예제 #17
0
파일: UnitType.cs 프로젝트: jzielke/Cubico
 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;
    }
예제 #20
0
        // 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"));
                }
            }
        }
예제 #21
0
 private void RefreshUnits()
 {
     Units.Clear();
     Units.AddRange(_salesReportUnits.Where(x => x.OrderInTakeDate >= StartDate && x.OrderInTakeDate <= FinishDate));
 }
예제 #22
0
 public override void LoadDefaults()
 {
     Units.Clear();
     IsLoaded = true;
 }
예제 #23
0
 public void clearAll()
 {
     SubjNo.Clear();
     DescTitle.Clear();
     Units.Clear();
 }