private void IncrementHouse(KeyboardState ks, SchoolScore school) { if (ks.IsKeyPressedOnce(Keys.D1)) school.HouseScores.ToArray()[0].Amount += _inc; if (ks.IsKeyPressedOnce(Keys.D2)) school.HouseScores.ToArray()[1].Amount += _inc; if (ks.IsKeyPressedOnce(Keys.D3)) school.HouseScores.ToArray()[2].Amount += _inc; if (ks.IsKeyPressedOnce(Keys.D4)) school.HouseScores.ToArray()[3].Amount += _inc; }
private void AddSchool(string schoolName, params string[] houseNames) { SchoolScore school = new SchoolScore { Name = schoolName }; school.Amount = 0; for (int i = 0; i < houseNames.Length; i++) { AddHouse(school, houseNames[i], i); } _schoolScores.Add(school); }
private void AddHouse(SchoolScore school, string houseName, int id) { school.UpdateHouseScores(new[] { new HouseScoreDto { Id = id, Name = houseName, Amount = 0 } }); }