private void presentForm(AbstractGameAttemptFactory.GameType gameType) { Hide(); GameAttemptsForm form = new GameAttemptsForm(gameType); form.Closed += (s, args) => Show(); form.Show(); }
public GameAttemptsForm(AbstractGameAttemptFactory.GameType gameType) : this() { this.gameType = gameType; gameTitle.Text = (gameType == AbstractGameAttemptFactory.GameType.DRAG_AND_DROP) ? "Drag and Drop" : "Space Ship"; AbstractGameAttemptFactory factory = AbstractGameAttemptFactory.getFactory(gameType); foreach (List <object> list in getData()) { GameAttempt attempt = factory.createAttempt(list); Score score = factory.createScore(list); dataGrid.Rows.Add(attempt.User, attempt.Timestamp, score.MadeIt() ? "Yes" : "No", score.HumanReadableString(), attempt.Details()); } }