Exemplo n.º 1
0
        /// <summary>
        /// This is the page where most of the game will happen.
        /// </summary>
        /// <param name="model"></param>
        public GamePage(BoggleClientModel model)
        {
            InitializeComponent();
            this.model = model;

            // test code - remove later
            //model.setBoard("ABCDEFGHIJKLMNOP");
            //model.setTime("322");
            //model.setOpponent("Lance");
            //model.setPlayerName("Basil");
            // remove above this

            // initialize scores to zero
            model.setPlayerScore("0");
            model.setOpponentScore("0");

            // set initial game information in view
            Timer.Text    = getRemainingTime(model.getTime());
            Opponent.Text = model.getOpponent();
            Player.Text   = model.getPlayerName();

            // initialize the boggle board
            InitializeBoard(model.getBoard().ToCharArray());

            model.TimeLineEvent       += TimeReceived;
            model.ScoreLineEvent      += ScoreReceived;
            model.StopLineEvent       += StopReceived;
            model.TerminatedLineEvent += TerminatedReceived;
            model.IgnoreLineEvent     += IgnoreReceived;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public HomePage(BoggleClientModel model)
        {
            InitializeComponent();
            this.model = model;

            model.StartLineEvent  += StartReceived;
            model.ConnectionEvent += ConnectionReceived;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor for MainWindow. This constructor simply creates a new
        /// BoggleClientModel object and passes it to the homepage.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            model = new BoggleClientModel();

            // Navigate to the home page.
            MainFrame.NavigationService.Navigate(new HomePage(model));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Summary of a boggle game
        /// </summary>
        /// <param name="model"></param>
        /// <param name="summary"></param>
        public SummaryPage(BoggleClientModel model, string summary)
        {
            InitializeComponent();

            this.model = model;

            MakeSummary(summary);
        }