Пример #1
0
        public void findNewGameNum()
        {
            FileReadAndWriter fileReadAndWriter = new FileReadAndWriter();

            newGameNum           = 1 + fileReadAndWriter.findLastGameNum(@"C: \Users\joeya\Desktop\Board Game Scores\Scores.csv");
            gameNumberLabel.Text = "Game Number: " + Convert.ToString(newGameNum);
        }
Пример #2
0
        public void initializeGameComboBox()
        {
            FileReadAndWriter fileReadAndWriter = new FileReadAndWriter();

            listOfGames = fileReadAndWriter.loadListOfGames(@"C: \Users\joeya\Desktop\Board Game Scores\Games.txt");
            foreach (Game game in listOfGames)
            {
                gameNameComboBox.Items.Add(game.name);
            }
        }
Пример #3
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            string fileLocation = @"C:\Users\joeya\Desktop\Board Game Scores\Scores.csv";

            string gameNumOutput = Convert.ToString(newGameNum) + ",";

            string gameName = gameNameComboBox.Text + ",";

            int    numOfExpansions = 0;
            string expansions      = "";

            for (int i = 0; i < expansionCheckBoxList.Items.Count; i++)
            {
                if (expansionCheckBoxList.GetItemChecked(i))
                {
                    numOfExpansions++;
                    expansions += expansionCheckBoxList.Items[i].ToString() + ",";
                }
            }

            string numberOfPlayers = Convert.ToString(numberOfPlayersNumericUpDown.Value) + ",";

            string nameOfPlayer = playerNameComboBox.Text + ",";

            string score = scoreTextBox.Text + ",";

            string place = Convert.ToString(placedUpDown.Value) + ",";

            string output = gameNumOutput + nameOfPlayer + score + numberOfPlayers + place + gameName + numOfExpansions + "," + expansions;

            FileReadAndWriter fileReadAndWriter = new FileReadAndWriter();

            fileReadAndWriter.outputScore(output, fileLocation);

            MessageBox.Show("Score Submited");
        }
Пример #4
0
        public void initializeScores()
        {
            FileReadAndWriter fileReadAndWriter = new FileReadAndWriter();

            listOfScores = fileReadAndWriter.loadScore(@"C:\Users\joeya\Desktop\Board Game Scores\Scores.csv");
        }