Beyond_Beyaan.Screens.PlanetsView.RefreshPlanets C# (CSharp) Метод

RefreshPlanets() публичный Метод

public RefreshPlanets ( List planets ) : void
planets List
Результат void
        public void RefreshPlanets(List<Planet> planets)
        {
            for (int i = 0; i < _maxVisible; i++)
            {
                _columnCells[0][i + _scrollBar.TopIndex].SetText(planets[i + _scrollBar.TopIndex].Name);
                _columnCells[1][i + _scrollBar.TopIndex].SetText(string.Format("{0:0.0}", planets[i + _scrollBar.TopIndex].TotalPopulation));
                _columnCells[2][i + _scrollBar.TopIndex].SetText(string.Format("{0:0.0}", planets[i + _scrollBar.TopIndex].Factories));
                _columnCells[3][i + _scrollBar.TopIndex].SetText(planets[i + _scrollBar.TopIndex].Bases.ToString());
                _columnCells[4][i + _scrollBar.TopIndex].SetText(string.Format("{0:0.0}", planets[i + _scrollBar.TopIndex].Waste));
                _columnCells[5][i + _scrollBar.TopIndex].SetText(((int)planets[i + _scrollBar.TopIndex].ActualProduction).ToString());
                _columnCells[6][i + _scrollBar.TopIndex].SetText(planets[i].ConstructionAmount > 0 ? planets[i + _scrollBar.TopIndex].ShipBeingBuilt.Name : string.Empty);
                for (int j = 0; j < 8; j++)
                {
                    _columnCells[j][i].Enabled = true;
                }
                if (i + _scrollBar.TopIndex == _selectedRow)
                {
                    for (int j = 0; j < 8; j++)
                    {
                        _columnCells[j][i].Selected = true;
                    }
                }
                else
                {
                    for (int j = 0; j < 8; j++)
                    {
                        _columnCells[j][i].Selected = true;
                    }
                }
            }
            for (int i = _maxVisible; i < 13; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    _columnCells[j][i].Enabled = false;
                }
            }
        }