static void Main(string[] args) { var carConstructor = new CarConstructor(); var car = carConstructor.Construct(new Engine("A good one engine", 4), new Color("Black"), new Transmission(TransmissionType.FullyAutomatic)); carConstructor.Reconstruct(car, new Engine("The best engine", 8)); }
// CONSTRUCTOR public ReplayHandler() { _safePlayerPrefs = Core.Instance.GetService <SafePlayerPrefs>(); _carConstructor = Core.Instance.GetService <CarConstructor>(); _gameManager = Core.Instance.GetService <GameManager>(); _playerManager = Core.Instance.GetService <PlayerManager>(); _uiManager = Core.Instance.GetService <UIManager>(); _finishWindow = _uiManager.GetWindow(UIWindowEnum.FINISH_ASYNC) as FinishWindow; _pauseWindow = _uiManager.GetWindow(UIWindowEnum.PAUSE_ASYNC) as PauseWindow; _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as GameWindowAsyncMultiplayer; _retryWindow = _uiManager.GetWindow(UIWindowEnum.RETRY_ASYNC) as RetryWindow; _audioService = Core.Instance.GetService <AudioService>(); Assert.AreNotEqual(null, _audioService); _statisticsService = Core.Instance.GetService <StatisticsService>(); Assert.AreNotEqual(null, _statisticsService); }