public PlayingFieldViewModel() { CreatingCells(); IdentifyNeighbours(); playGameCommand = new PlayGameCommand(PlayGame); pauseGameCommand = new PauseGameCommand(PauseGame); restartGameCommand = new RestartGameCommand(RestartGame); }
public void Handle(PlayGameCommand command) { using (var session = _sessionFactory.OpenSession()) { var competition = CompetitionRepository.GetOrCreate(_eventBus); competition.PlayGame(command.RedOffensive, command.RedDefensive, command.BlueOffensive, command.BlueDefensive, command.ScoreRed, command.ScoreBlue); session.SubmitChanges(); } }
public QuizzVM() { UserData = new UserData(); initUserData(); /*Setup commands*/ ChooseAnswerCommand = new ChooseAnswerCommand(this); PlayGameCommand = new PlayGameCommand(this); NextQuestionCommand = new NextQuestionCommand(this); ToMenuWindowCommand = new ToMenuWindowCommand(this); ToInfoWindowCommand = new ToInfoWindowCommand(this); /*Setup Properties*/ Questions = new ObservableCollection <Question>(); /*Setup the values for the ComboBoxes*/ KindOfQuestionsComboBox = new List <string> { "Any Category", "General Knowledge", "Books", "Films", "Music", "Musicals & Theatre", "Television", "Video Games", "Board Games", "Sience & Nature", "Computers", "Mathematics", "Mythology", "Sports", "Geography", "History", "Politics", "Art", "Celebrities", "Animals" }; AmountOfQuestionsComboBox = new List <string> { "5", "10", "12", "15", "20", "25" }; /*Setup the default colors of the question boxes*/ BG1 = new SolidColorBrush(Colors.LightGray); BG2 = new SolidColorBrush(Colors.LightGray); BG3 = new SolidColorBrush(Colors.LightGray); BG4 = new SolidColorBrush(Colors.LightGray); /*Start with Menu window*/ showMenuWindow(); GameOver = false; }