public BonusQuestions readBonus(string filename, int sheet) { Initialise(filename, sheet); string kampioen = xlRange.Cells[103, 5].value2; string topscorer = xlRange.Cells[104, 5].value2;; string nl = xlRange.Cells[105, 5].value2; if (kampioen == null) { kampioen = ""; } if (topscorer == null) { topscorer = ""; } if (nl == null) { nl = ""; } BonusQuestions b = new BonusQuestions(kampioen.ToLower(), topscorer.ToLower(), nl.ToLower()); Clean(); return(b); }
public int CheckBonus(BonusQuestions HostQuestions) { if (HostQuestions == null) { throw new ArgumentNullException(); } int score = 0; foreach (var a in Answers) { var ans = HostQuestions.Answers[a.Key]; if (a.Value.Answer == ans.Answer && ans.Answer != "") { score += a.Value.Points; } } return(score); }
public Player(string name, string town, List <PoolMatchResult> poolmatches, KnockOutPhase KO, BonusQuestions BQ) { if (name != "Host") { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(); } } if (poolmatches == null || KO == null) { throw new ArgumentNullException(); } Name = name; Score = 0; Results = poolmatches; KnockOut = KO; Questions = BQ; }