Esempio n. 1
0
        public TriviaGameEditorControlViewModel(TriviaGameCommand command)
            : this()
        {
            this.existingCommand = command;

            this.TimeLimit = this.existingCommand.TimeLimit;
            this.WinAmount = this.existingCommand.WinAmount;

            this.WinAmount = this.existingCommand.WinAmount;

            this.StartedCommand = this.existingCommand.StartedCommand;

            this.UserJoinCommand = this.existingCommand.UserJoinCommand;

            this.UserSuccessCommand = this.existingCommand.UserSuccessOutcome.Command;

            this.CorrectAnswerCommand = this.existingCommand.CorrectAnswerCommand;

            this.UseRandomOnlineQuestions = this.existingCommand.UseRandomOnlineQuestions;

            foreach (TriviaGameQuestion question in command.CustomQuestions)
            {
                this.CustomQuestions.Add(new TriviaGameQuestionViewModel(this, question));
            }
        }
        public TriviaGameEditorControl(TriviaGameCommand command)
        {
            InitializeComponent();

            this.existingCommand = command;
            this.viewModel       = new TriviaGameEditorControlViewModel(command);
        }
Esempio n. 3
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            Dictionary <UserRoleEnum, int> roleProbabilities = new Dictionary <UserRoleEnum, int>()
            {
                { UserRoleEnum.User, 0 }, { UserRoleEnum.Subscriber, 0 }, { UserRoleEnum.Mod, 0 }
            };

            GameCommandBase newCommand = new TriviaGameCommand(name, triggers, requirements, this.TimeLimit, this.StartedCommand, this.UserJoinCommand,
                                                               new GameOutcome("Success", 0, roleProbabilities, this.UserSuccessCommand), this.CustomQuestions.Select(q => q.GetQuestion()), this.WinAmount, this.CorrectAnswerCommand,
                                                               this.UseRandomOnlineQuestions);

            this.SaveGameCommand(newCommand, this.existingCommand);
        }