Exemplo n.º 1
0
        public static void Refresh(string materialId = "")
        {
            if (materialId == "")
            {
                for (int i = 0; i < Generals.Length; i++)
                {
                    Generals[i].Save();
                }
            }
            else
            {
                List <General> generals = Generals.Where(gen => gen.BuildCosts.Count(item => item.Id == materialId) != 0 && gen.BuildCosts.Count(item => Material.GetMaterial(item.Id).Weight == null) == 0).ToList();

                foreach (General general in generals)
                {
                    general.Update();
                }
            }
        }