Beispiel #1
0
 private void PassExam(GameInfo gameInfo, IGameState waitState)
 {
     gameInfo.CurrentPlayer.PassedExam = true;
     gameInfo.Content.Load<SoundEffect>("Sounds/applause").Play();
     gameInfo.CurrentPlayer.CurrentlyTakingExam = false;
     var alert = new Alert(gameInfo.Manager, "You passed your exam! Start your career", title: "Congratulations! You passed your exam!", icon: "Images/AlertIcons/Graduated" + gameInfo.CurrentPlayer.Gender);
     alert.BringToFront();
     alert.Closed += (sender, args) => gameInfo.Fsm.Remove(waitState);
     gameInfo.Manager.Add(alert);
     gameInfo.Fsm.Push(new StartCareer());
     gameInfo.Fsm.Push(waitState);
 }
Beispiel #2
0
 private void SellHouse(Player player, House house, Window window)
 {
     CloseMenuWindow();
     var alertString = String.Format("You just sold your house {0} for a price of ${1:N0}" +
                                     "\n\nYou made a profit of ${2:N0}",
                                     house.Name, house.Value, house.Value - house.PlayerBuyingValue);
     var alert = new Alert(ControlManager.Manager, alertString, "House Sold");
     ControlManager.Add(alert);
     player.Remove(house);
     alert.BringToFront();
     window.Enabled = false;
     alert.Closed += (sender, args) => window.Enabled = true;
 }