private void btnEditSettings_Click(object sender, EventArgs e) { var deep = Convert.ToInt32(nudDeep.Value); var width = Convert.ToInt32(nudWidth.Value); var speed = Convert.ToInt32(nudSpeed.Value); WorkWithSettings.SaveSettings(deep, width, speed); }
public Game() { var settings = WorkWithSettings.GetSettings(); Deep = settings.deep; Width = settings.width; Interval = Convert.ToInt32(Math.Round(Constants.MilisecondsInAMinute / settings.speed)); GameField = new TypeOfCell[Deep, Width]; _startColumn = Convert.ToInt32(Math.Round((double)Width / 2) - 1); }
private void tabControl1_Selected(object sender, TabControlEventArgs e) { //work with settings var settings = WorkWithSettings.GetSettings(); nudDeep.Value = settings.deep; nudWidth.Value = settings.width; nudSpeed.Value = settings.speed; //work with records var players = WorkWithRecords.GetPlayers(); var records = RecordHandler.GetRecords(players); lblRecords.Text = records; }