Exemple #1
0
        /*
         * private void EndDraftButton_Click(object sender, EventArgs e)
         *
         * NAME:
         *  EndDraftButton_Click
         * SYNOPSIS:
         *
         *  private void EndDraftButton_Click(object sender, EventArgs e);
         *    sender --> reference to object that raised event.
         *    e --> event data
         *
         * DESCRIPTION:
         *
         *  Event Handler for the EndDraftButton, ends the drafting
         *  phase and shows the home page
         *
         * RETURNS:
         *  None
         * AUTHOR:
         *  Gabriel Uy
         * DATE:
         *  07/12/2020
         */
        private void EndDraftButton_Click(object sender, EventArgs e)
        {
            Hide();
            ShowGame showGame = new ShowGame(_game, player1, cpu1, cpu2, cpu3, _season);

            showGame.Show();
        }
 /*
  * 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]);
     }
 }
Exemple #4
0
        /*
         * 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]);
            }
        }