Beyond_Beyaan.Screens.NewGame.OnRaceSelectionOKClick C# (CSharp) Метод

OnRaceSelectionOKClick() приватный Метод

private OnRaceSelectionOKClick ( int whichPlayer, Race whichRace ) : void
whichPlayer int
whichRace Beyond_Beyaan.Data_Modules.Race
Результат void
        private void OnRaceSelectionOKClick(int whichPlayer, Race whichRace)
        {
            _showingSelection = false;
            for (int i = 0; i < _playerRaces.Length; i++)
            {
                if (i != whichPlayer && _playerRaces[i] == whichRace)
                {
                    _playerRaces[i] = null;
                    _raceSprites[i] = _randomRaceSprite;
                    if (i == 0)
                    {
                        _playerRaceDescription.SetText("A random race will be chosen.  If the Emperor and/or Homeworld name fields are left blank, default race names for those will be used.");
                    }
                    break;
                }
            }
            _playerRaces[whichPlayer] = whichRace;
            if (whichRace == null)
            {
                _raceSprites[whichPlayer] = _randomRaceSprite;
            }
            else
            {
                _raceSprites[whichPlayer] = whichRace.MiniAvatar;
            }
            if (whichPlayer == 0)
            {
                if (whichRace == null)
                {
                    _playerRaceDescription.SetText("A random race will be chosen.  If the Emperor and/or Homeworld name fields are left blank, default race names for those will be used.");
                }
                else
                {
                    _playerRaceDescription.SetText(whichRace.RaceDescription);
                }
            }
        }