Beispiel #1
0
        public Objects.Player NextBatter(Objects.Team team, TeamManager teamManager)
        {
            if (Turn < teamManager.BattingOrder.Count)
            {
                Turn++;
            }
            else
            {
                Turn = 1;
            }

            return(teamManager.BattingOrder[Turn - 1].Clone() as Objects.Player);
        }
Beispiel #2
0
 public void SetBattingOrder(Objects.Team team, MLB mlb, PlayersRoster players, TeamManager teamManager)
 {
     //team.battingOrder = Players.Where(T => T.Team.Equals(team.Abbrev)).DefaultIfEmpty().ToList();
     if (mlb.Teams.Any(T => T.Abbrev.Equals(team.Abbrev)))
     {
         teamManager.BattingOrder = Players.Where(T => T.Team.Equals(team.Abbrev)).DefaultIfEmpty().ToList();
     }
     else
     {
         PickLineUp lineUp = new PickLineUp();
         teamManager.BattingOrder = lineUp.GetPlayers(players, mlb);
     }
 }
Beispiel #3
0
        public void SettingNewTeam(Objects.Team team, MLB mlb, string choice, bool atAway)
        {
            if (!mlb.Teams.Any(T => T.Abbrev.ToLower().Equals(choice.ToLower())))
            {
                team.Abbrev = choice;
                team.Name   = choice;
                Output.WriteStringOutput("What DefEff you want this team to have? MLB average is 0.687, right now ranging from 0.669-0.719");
                team.DefEff = Convert.ToDouble(Console.ReadLine());
                Output.WriteStringOutput("Just need 2 more things. Fielding Recentage? MLB average is 0.983, right now ranging from 0.976-0.989");
                team.FP = Convert.ToDouble(Console.ReadLine());

                if (atAway)
                {
                    Output.WriteStringOutput("What about On-Base Average (Pitching) when playing at Away? MLB is right now ranging between 0.229-0.278");
                    team.OBAAway = Convert.ToDouble(Console.ReadLine());
                }
                else
                {
                    Output.WriteStringOutput("What about On-Base Average (Pitching) when playing at Home? MLB is right now ranging between 0.214-0.298");
                    team.OBAHome = Convert.ToDouble(Console.ReadLine());
                }
            }
        }