public Controller() { InputView = new InputView(); OutputView = new OutputView(); map = new Map(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); MyTimer = new System.Timers.Timer(); MyTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); Playing = true; Start(); }
public void Start() { MyTimer.Interval = _waitTime; MyTimer.Enabled = true; while (Playing) { int result = InputView.GetSwitchNumber(); switch (result) { case -1: Environment.Exit(0); break; case 1: map.SwitchSwitch(1); Console.Clear(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); break; case 2: map.SwitchSwitch(2); Console.Clear(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); break; case 3: map.SwitchSwitch(3); Console.Clear(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); break; case 4: map.SwitchSwitch(4); Console.Clear(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); break; case 5: map.SwitchSwitch(5); Console.Clear(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); break; } } }