public ReactorStates GetNextState(ReactorStates currentState) { if (currentState.StateNumber <= _poolStates.Count) { return(_poolStates[currentState.StateNumber]); } else { return(currentState); } }
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); } }
private void OnStateChanged(ReactorStates newReactorState) { _currentCountMetalsForLevelUp = newReactorState.MetalsForNextLevel; _currentState = newReactorState.State; if (newReactorState.StateNumber == 3) { _levelUpButton.interactable = false; } MenuUpdate(); }