Beispiel #1
0
 public GameManager(int columns, int maxRows, int numberOfBlockTypes)
 {
     MaxRows             = maxRows;
     NumberOfColumns     = columns;
     _numberOfBlockTypes = numberOfBlockTypes;
     Scoreboard          = Scoreboard.Load("Columns.Scoreboard.txt");
     OnlineScoreBoard    = new Scoreboard();
 }
Beispiel #2
0
        internal static Scoreboard LoadFromServer()
        {
            var scoreboard = new Scoreboard();

            var    client = new scoreswsdlPortTypeClient();
            string scores = client.getscores("normal");

            string[] scoresArray = scores.Split(',');

            foreach (string entry in scoresArray)
            {
                string[] entryArray = entry.Split('#');
                scoreboard.Add(new ScoreboardEntry(entryArray[1], Convert.ToInt32(entryArray[0]), entryArray[2]));
            }

            return(scoreboard);
        }
Beispiel #3
0
 private void GameManagerPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "GameOver")
     {
         if (GameManager.GameOver)
         {
             _showOverlay = true;
         }
         else
         {
             startButton.IsEnabled = false;
         }
         NotifyPropertyChanged("GameoverPopupVisibility");
         NotifyPropertyChanged("HasHighScoreVisibility");
     }
     if (e.PropertyName == "Scoreboard")
     {
         Scoreboard.Clear();
         GameManager.Scoreboard.ForEach(score => Scoreboard.Add(score));
     }
 }
Beispiel #4
0
 public void AddScore(string name)
 {
     Scoreboard.Add(new ScoreboardEntry(name, TotalScore));
     Scoreboard.Save();
     NotifyPropertyChanged("Scoreboard");
 }