public GetOutWinForm(Menu mainForm) { winControl = new WinControl(this); loseControl = new LoseControl(this); enterPasswordControl = new EnterPasswordControl(this); hintControl = new HintControl(this); FormBorderStyle = FormBorderStyle.FixedSingle; StartPosition = FormStartPosition.CenterScreen; BackColor = Color.FromArgb(228, 220, 168); InitializeComponent(); MainForm = mainForm; AutoSize = true; DoubleBuffered = true; updateTimer = new Timer(); updateTimer.Interval = 100; updateTimer.Tick += new EventHandler(Update); if (!lockKeybord) { KeyDown += new KeyEventHandler(OnPress); KeyUp += new KeyEventHandler(OnKeyUp); } FormClosed += CloseButton_Click; levelsManager = new LevelsManager(); map = levelsManager.GetNextLevel(); Init(); }
public void CheckStartGame() { var levelsManager = new LevelsManager(); levelsManager.GetNextLevel(); Assert.AreEqual(0, levelsManager.CurrentLevel.NumberLevel); }
private void ShowWinControl() { map.Win = true; pressE = false; Controls.Clear(); winControl.Init(); winControl.NextLevelButton.Click += (s, e) => { lockKeybord = false; winControl.Controls.Clear(); Controls.Clear(); map = levelsManager.GetNextLevel(); Init(); }; Controls.Add(winControl); }