Пример #1
0
 public ReactorStates GetNextState(ReactorStates currentState)
 {
     if (currentState.StateNumber <= _poolStates.Count)
     {
         return(_poolStates[currentState.StateNumber]);
     }
     else
     {
         return(currentState);
     }
 }
Пример #2
0
 public void LevelUp()
 {
     if (_miningRobot.GiveMetals(_currentReactorState.MetalsForNextLevel))
     {
         _currentReactorState = _poolStatesReactor.GetNextState(_currentReactorState);
         _maxPowerCount       = _currentReactorState.CountRoomsPowered * _powerForRoom;
         _countPower          = _maxPowerCount - _countPoweredRooms * _powerForRoom;
         PowerChanged?.Invoke(_countPower);
         StateChanged?.Invoke(_currentReactorState);
     }
 }
Пример #3
0
    private void OnStateChanged(ReactorStates newReactorState)
    {
        _currentCountMetalsForLevelUp = newReactorState.MetalsForNextLevel;
        _currentState = newReactorState.State;

        if (newReactorState.StateNumber == 3)
        {
            _levelUpButton.interactable = false;
        }

        MenuUpdate();
    }