Beyond_Beyaan.Screens.ResearchPrompt.MouseUp C# (CSharp) Метод

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

public MouseUp ( int x, int y ) : bool
x int
y int
Результат bool
        public override bool MouseUp(int x, int y)
        {
            if (_techDescription.MouseUp(x, y))
            {
                return true;
            }
            for (int i = 0; i < _maxVisible; i++)
            {
                if (_availableTechsToResearchButtons[i].MouseUp(x, y))
                {
                    switch (_currentTechField)
                    {
                        case TechField.COMPUTER:
                            _currentEmpire.TechnologyManager.WhichComputerBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                        case TechField.CONSTRUCTION:
                            _currentEmpire.TechnologyManager.WhichConstructionBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                        case TechField.FORCE_FIELD:
                            _currentEmpire.TechnologyManager.WhichForceFieldBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                        case TechField.PLANETOLOGY:
                            _currentEmpire.TechnologyManager.WhichPlanetologyBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                        case TechField.PROPULSION:
                            _currentEmpire.TechnologyManager.WhichPropulsionBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                        case TechField.WEAPON:
                            _currentEmpire.TechnologyManager.WhichWeaponBeingResearched = _availableTopics[_currentTechField][i + _scrollBar.TopIndex];
                            break;
                    }
                    _availableTopics.Remove(_currentTechField);
                    if (_availableTopics.Count > 0)
                    {
                        LoadNextTech();
                    }
                    else if (Completed != null)
                    {
                        Completed();
                    }
                    return true;
                }
            }
            if (_scrollBar.MouseUp(x, y))
            {
                RefreshTechButtons();
                return true;
            }
            return false;
        }

Usage Example

 public void MouseUp(int x, int y, int whichButton)
 {
     if (whichButton != 1)
     {
         return;
     }
     if (_exploredSystemsThisTurn.Count > 0)
     {
         _exploredSystemsThisTurn[_whichEmpireFocusedOn].RemoveAt(0);
         if (_exploredSystemsThisTurn[_whichEmpireFocusedOn].Count > 0)
         {
             _systemInfoWindow.LoadExploredSystem(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0]);
             _systemView.LoadSystem(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0], _whichEmpireFocusedOn);
             _camera.CenterCamera(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0].X, _exploredSystemsThisTurn[_whichEmpireFocusedOn][0].Y, 1);
         }
         else
         {
             _exploredSystemsThisTurn.Remove(_whichEmpireFocusedOn);
             if (_exploredSystemsThisTurn.Count > 0)                     //Hot seat humans
             {
                 foreach (var keyPair in _exploredSystemsThisTurn)
                 {
                     _whichEmpireFocusedOn = keyPair.Key;
                     break;
                 }
                 _systemInfoWindow.LoadExploredSystem(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0]);
                 _systemView.LoadSystem(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0], _whichEmpireFocusedOn);
                 _camera.CenterCamera(_exploredSystemsThisTurn[_whichEmpireFocusedOn][0].X, _exploredSystemsThisTurn[_whichEmpireFocusedOn][0].Y, 1);
             }
             else
             {
                 _camera.CenterCamera(_camera.Width / 2, _camera.Height / 2, _camera.MaxZoom);
             }
         }
     }
     if (_colonizableFleetsThisTurn.Count > 0)
     {
         _colonizeScreen.MouseUp(x, y);
     }
     if (_newResearchTopicsNeeded.Count > 0)
     {
         _researchPrompt.MouseUp(x, y);
     }
 }