Ejemplo n.º 1
0
        private void GameView_Load(object sender, EventArgs e)
        {
            RPSLSView             rpslsView   = controller.GetRPSLSView();
            List <ScoreBoardView> scoreboards = controller.GetScoreboardViews();
            int scoreboardWidth  = scoreboards.First().Width;
            int scoreboardHeight = scoreboards.First().Height;

            //scoreboardView.Width = 100;
            //scoreboardView.Height = 100;
            //scoreboards.Location = new Point(0, 200);
            this.Width = scoreboards.Count();
            //this.Width = rpslsView.Width;
            this.Height = 400;

            foreach (ScoreBoardView scoreboard in scoreboards)
            {
                ScoreBoardView tempScoreboard = scoreboard;
                int            xPos           = scoreboards.IndexOf(scoreboard) * scoreboardWidth;
                scoreboard.Location = new Point(xPos, 230);
                Controls.Add(tempScoreboard);
            }

            // Debugging
            Console.WriteLine("RPSLS Location: " + rpslsView.Location);
            Console.WriteLine("RPSLS Height: " + rpslsView.Height);
            Controls.Add(rpslsView);
        }
        public List <ScoreBoardView> GetScoreboardViews()
        {
            List <ScoreBoardView> viewOfScoreboards = new List <ScoreBoardView>();

            foreach (ScoreBoardController scoreboard in scoreboards)
            {
                ScoreBoardView scoreboardView = scoreboard.GetView();
                viewOfScoreboards.Add(scoreboardView);
            }
            return(viewOfScoreboards);
        }
 public ScoreBoardController( GameController c, int pointsRequiredForSetParameter)
 {
     gameController = c;
     view = new ScoreBoardView(this);
     model = new ScoreBoardModel(this, pointsRequiredForSetParameter);
 }
 public ScoreBoardController(GameController c, int pointsRequiredForSetParameter)
 {
     gameController = c;
     view           = new ScoreBoardView(this);
     model          = new ScoreBoardModel(this, pointsRequiredForSetParameter);
 }