/// <summary> /// Timer for the Game. Actions are performed during every tick, like /// resource production and upgrading buildings. /// Also, checks game victory condition. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void timerGame_Tick(object sender, EventArgs e) { if (_kingdom.CastleDistrict.UpgradeLevel == _kingdom.CastleDistrict.MaxUpgradeLevel) { GameStartStop(false); MessageBox.Show($"Congratulations, you have completed the Castle in {labelGameTime.Text} hours! Now these lands are safe and you will be greatly rewarded!", "You won!"); Close(); } _kingdom.OnTick(); UpdateControls(); }