/* * public ShowTeamRoster(Game g, LeaugeTeam p1, ShowGame sg) * * NAME: ShowTeamRoster - constructor for the ShowTeamRoster class * * SYNOPSIS: * * public ShowTeamRoster(Game g, LeaugeTeam p1, ShowGame sg); * g --> The current game object to be able to use its public functions * p1 --> the human players LeaugeTeam object to used to access the * team roster. * sg--> The form object used to display the information on the GUI * * DESCRIPTION: * * This is the constructor for the ShowTeamRoster form class, it takes in the * current game's object, human player's LeaugeTeam object, and the ShowGame object. * it creates a local object for all the parameters so that no unwanted changes are made to the * original objects since they are just used to get information. * * RETURNS: * None * AUTHOR: * Gabriel Uy * DATE: * 07/08/2020 */ public ShowTeamRoster(Game g, LeaugeTeam p1, ShowGame sg) { InitializeComponent(); __player1 = p1; __game = g; _showGame = sg; foreach (int player in __player1.team) { TeamList.Items.Add((__player1.team.IndexOf(player) + 1) + ". " + __game.GetPlayerName(player)); } }
/* * public ShowFreeAgents(Game g, ShowGame sg, LeaugeTeam p1) * * NAME: * ShowFreeAgents * SYNOPSIS: * * public ShowFreeAgents(Game g, ShowGame sg, LeaugeTeam p1); * g --> The current game object to be able to use its public functions * p1 --> the human players LeaugeTeam object to used to access the * team roster. * sg--> The form object used to display the information on the GUI * * DESCRIPTION: * * Contstructor for the ShowFreeAgents class * * RETURNS: * None * AUTHOR: * Gabriel Uy * DATE: * 07/08/2020 */ public ShowFreeAgents(Game g, ShowGame sg, LeaugeTeam p1) { InitializeComponent(); _game = g; _showGame = sg; __player1 = p1; //https://stackoverflow.com/questions/19300044/button-performclick-not-working-in-form-load/19300323 6/29/20 Load += ShowFreeAgents_Load; AddDropButton.Enabled = false; foreach (int player in __player1.team) { PlayersTeamList.Items.Add(_game._PlayerName[player]); } }
/* * public ShowGame(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, string seas) * * NAME: * ShowGame * SYNOPSIS: * * public ShowGame(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, string seas); * g --> current Game object being used * p1 --> The human players LeaugeTeam object * c1 --> CPU1's LeaugeTeam object * c2 --> CPU2's LeaugeTeam object * c3 --> CPU3's LeaugeTeam object * seas --> The season that the user selected to be simulated * * DESCRIPTION: * * Constructor for the ShowGame class * * RETURNS: * None * AUTHOR: * Gabriel Uy * DATE: * 07/08/2020 */ public ShowGame(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, string seas) { InitializeComponent(); _game = g; _player1 = p1; _cpu1 = c1; _cpu2 = c2; _cpu3 = c3; __season = seas; pictureBox1.Load("https://d2p3bygnnzw9w3.cloudfront.net/req/202006171/tlogo/bbr/NBA-2019.png"); SeasonLabel.Text = "The " + __season + " Season"; ShowSchedule(); _game.ShowStandings(_game.Teams); }
/* * public ShowTrading(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, ShowGame sg) * * NAME: * ShowTrading * SYNOPSIS: * * public ShowTrading(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, ShowGame sg); * g --> the current game object * c1 --> cpu1's object * c2 --> cpu2's object * c3 --> cpu3's object * DESCRIPTION: * * constructor for the ShowTrading class * * RETURNS: * None * AUTHOR: * Gabriel Uy * DATE: * 07/27/2020 */ public ShowTrading(Game g, LeaugeTeam p1, LeaugeTeam c1, LeaugeTeam c2, LeaugeTeam c3, ShowGame sg) { InitializeComponent(); __game = g; __player1 = p1; __cpu1 = c1; __cpu2 = c2; __cpu3 = c3; _showGame = sg; Team1Button.Text = __cpu1.GetName(); Team2Button.Text = __cpu2.GetName(); Team3Button.Text = __cpu3.GetName(); foreach (int player in __player1.team) { PlayersPlayerBox.Items.Add(__game._PlayerName[player]); } }