Beispiel #1
0
 public CG(Team home, Team away, Game game)
 {
     _away = away;
     _home = home;
     _game = game;
     ClearScreen();
     DownDistanceVisible = false;
 }
Beispiel #2
0
 private void UpdatePlayerCG(Team.Player player, PlayerStats stats, string superToShow, string logo)
 {
     if (!CGOverrideCheck.Checked)
     {
         CG.BugVisible = false;
         var command = CG.PlayerCGCommand(player, stats, superToShow, logo);
         if (!String.IsNullOrEmpty(command))
         {
             lyricService.Send(command);
             lyricService.Send("V\\5\\3\\1\\1\\100\\1\\\\");
         }
     }
 }
Beispiel #3
0
        //private SettingsForm _settingsForm;
        public MainForm()
        {
            lyricService = new LyricService();
            playerService = new PlayerService();

            InitializeComponent();

            var gameFile = "C:\\Users\\Joe\\Dropbox\\GVSU\\XLS Files\\GameData.xlsx";
            if(!File.Exists(gameFile))
            {
                LoadTeamFile.Title = "Choose File For Game Data";
                DialogResult gameData = LoadTeamFile.ShowDialog();
                if (gameData == DialogResult.OK)
                {
                    gameFile = LoadTeamFile.FileName;
                }
            }

            Game = new Game(gameFile);

            LoadTeamFile.Title = "Choose File For Home Team";
            DialogResult homeFile = LoadTeamFile.ShowDialog();
            if (homeFile == DialogResult.OK)
            {
                var file = LoadTeamFile.FileName;
                try
                {
                    Home = new Team(file);
                }
                catch (Exception er)
                {

                }
            }

            LoadTeamFile.Title = "Choose File For Away Team";
            DialogResult awayFile = LoadTeamFile.ShowDialog();
            if (awayFile == DialogResult.OK)
            {
                var file = LoadTeamFile.FileName;
                try
                {
                    Away = new Team(file);
                }
                catch (Exception er)
                {

                }
            }

            CG = new CG(Home, Away, Game);

            QuarterLabel.Text = Game.QuarterLong;
            Game.ClockVisible = true;
            updateClockForm();
            TimerIntervalLabel.Text = GameTimer.Interval.ToString();

            AwayTeamLabel.Text = Away.BugName;
            HomeTeamLabel.Text = Home.BugName;
            AwayTeamScoreLabel.Text = Away.Score.ToString();
            HomeTeamScoreLabel.Text = Home.Score.ToString();

            DownLabel.Text = Game.Down;
            YardsToGoTextBox.Text = "10";

            // instantiate data service with necessary site
            DataAddress.Text = "http://static.sidearmstats.com/static/json_gvsu_football_stats.js";
            var dataAddress = DataAddress.Text;
            dataService = new DataService(dataAddress);

            // pre populate labels and buttons
            HomeCoachLabel.Text = Home.CoachName;
            AwayCoachLabel.Text = Away.CoachName;
            ShowAnnouncer1.Text = Game.Announcer1;
            ShowAnnouncer2.Text = Game.Announcer2;
            ShowAnnouncerDouble.Text = Game.Announcer1 + " / " + Game.Announcer2;

            // clear out player labels
            homePlayerLabel1.Text = "";
            HomePlayer1PassingLabel.Text = "";
            HomePlayer1ReceivingLabel.Text = "";
            HomePlayer1RushingLabel.Text = "";

            awayPlayerLabel1.Text = "";
            AwayPlayer1PassingLabel.Text = "";
            AwayPlayer1ReceivingLabel.Text = "";
            AwayPlayer1RushingLabel.Text = "";
        }
Beispiel #4
0
 public String TitlePage(Team home, Team away, Game game)
 {
     var returnString = "";
     returnString = @"W\\100\\1003\\" + game.GameTitle + "\\" + away.Logo + "\\" + away.Name + "\\" + away.Mascot + "\\" + away.Record + "\\" + home.Logo + "\\" + home.Name + "\\" + home.Mascot + "\\" + home.Record + "\\" + game.GameVenue + "\\" + game.GameLocation + "\\\\";
     return returnString;
 }
Beispiel #5
0
        public String PlayerCGCommand(Team.Player player, PlayerStats stats, string superToShow, string logo)
        {
            string returnString = SetDissolve();

            switch(superToShow)
            {
                case "Bio":
                    returnString = returnString + "W\\100\\1001\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\" + player.Height + "\\" + player.Weight + "\\" + player.Year + "\\" + player.Hometown + "\\" + logo + "\\\\";
                    return returnString;
                case "Passing":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Comp\\Att\\Yards\\TD\\";
                    if (stats != null)
                    {
                        if (stats.PassStats.PassingInt > 0)
                        {
                            returnString = returnString + "Int\\" + stats.PassStats.PassingCompletions + "\\" + stats.PassStats.PassingAttempts + "\\" + stats.PassStats.PassingYards + "\\" + stats.PassStats.PassingTd + "\\" + stats.PassStats.PassingInt + "\\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + "\\ \\" + stats.PassStats.PassingCompletions + "\\" + stats.PassStats.PassingAttempts + "\\" + stats.PassStats.PassingYards + "\\" + stats.PassStats.PassingTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
                case "Rushing":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Att\\Yards\\Avg\\";
                    if (stats != null)
                    {
                        if (stats.RushStats.RushTd > 0)
                        {
                            returnString = returnString + "TD\\ \\" + stats.RushStats.RushAttempts + "\\" + stats.RushStats.RushYards + "\\" + stats.RushStats.RushAverage + "\\" + stats.RushStats.RushTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + " \\ \\" + stats.RushStats.RushAttempts + "\\" + stats.RushStats.RushYards + "\\" + stats.RushStats.RushAverage + "\\ \\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
                case "Receiving":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Rec\\Yards\\Avg\\";
                    if (stats != null)
                    {
                        if (stats.RecStats.ReceivingTd > 0)
                        {
                            returnString = returnString + "TD\\ \\" + stats.RecStats.Receptions + "\\" + stats.RecStats.ReceivingYards + "\\" + stats.RecStats.ReceivingAverage + "\\" + stats.RecStats.ReceivingTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + " \\ \\" + stats.RecStats.Receptions + "\\" + stats.RecStats.ReceivingYards + "\\" + stats.RecStats.ReceivingAverage + "\\ \\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
            }

            return returnString;
        }
Beispiel #6
0
 public Models.Team.Player GetPlayerByPlayerNumber(int playerNum, Team team)
 {
     var returnPlayer = new Team.Player();
     return team.Players.Where(x => x.Number == playerNum).SingleOrDefault();
 }