Esempio n. 1
0
        /// <summary>
        /// Get new data and update listview with new list of ScoreViewObjs
        /// </summary>
        /// <returns></returns>
        private async Task RequestScore()
        {
            int newScore             = 0;
            List <ScoreViewObj> temp = logic.GetScore(await ScoreData.GetList()); //Get data from serer for current room

            //Combine scores into a total score
            foreach (ScoreViewObj obj in temp)
            {
                newScore += obj.ScoreChange;
            }

            //Update score label to new current score
            scoreLabel.Text = newScore.ToString() + " / " + temp.Count * Constants.MAX_SCORE_PER_HOUR;
            //Set itemsource for listview to be new data
            scoreListView.ItemsSource = temp;
        }