public HitmanGameEditorControl(HitmanGameCommand command) { InitializeComponent(); this.existingCommand = command; this.viewModel = new HitmanGameEditorControlViewModel(command); }
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 HitmanGameCommand(name, triggers, requirements, this.MinimumParticipants, this.TimeLimit, this.CustomHitmanNamesFilePath, this.HitmanTimeLimit, this.StartedCommand, this.UserJoinCommand, this.HitmanApproachingCommand, this.HitmanAppearsCommand, new GameOutcome("Success", 0, roleProbabilities, this.UserSuccessCommand), new GameOutcome("Failure", 0, roleProbabilities, this.UserFailCommand), this.NotEnoughPlayersCommand); this.SaveGameCommand(newCommand, this.existingCommand); }
public HitmanGameEditorControlViewModel(HitmanGameCommand command) : this() { this.existingCommand = command; this.MinimumParticipants = this.existingCommand.MinimumParticipants; this.TimeLimit = this.existingCommand.TimeLimit; this.HitmanTimeLimit = this.existingCommand.HitmanTimeLimit; this.CustomHitmanNamesFilePath = this.existingCommand.CustomWordsFilePath; this.StartedCommand = this.existingCommand.StartedCommand; this.UserJoinCommand = this.existingCommand.UserJoinCommand; this.NotEnoughPlayersCommand = this.existingCommand.NotEnoughPlayersCommand; this.HitmanApproachingCommand = this.existingCommand.HitmanApproachingCommand; this.HitmanAppearsCommand = this.existingCommand.HitmanAppearsCommand; this.UserSuccessCommand = this.existingCommand.UserSuccessOutcome.Command; this.UserFailCommand = this.existingCommand.UserFailOutcome.Command; }
public override void SaveGameCommand() { int.TryParse(this.MinimumParticipantsTextBox.Text, out int minimumParticipants); int.TryParse(this.TimeLimitTextBox.Text, out int timeLimit); int.TryParse(this.HitmanTimeLimitTextBox.Text, out int hitmanTimeLimit); Dictionary <MixerRoleEnum, int> roleProbabilities = new Dictionary <MixerRoleEnum, int>() { { MixerRoleEnum.User, 0 }, { MixerRoleEnum.Subscriber, 0 }, { MixerRoleEnum.Mod, 0 } }; GameCommandBase newCommand = new HitmanGameCommand(this.CommandDetailsControl.GameName, this.CommandDetailsControl.ChatTriggers, this.CommandDetailsControl.GetRequirements(), minimumParticipants, timeLimit, this.CustomHitmanNamesFilePathTextBox.Text, hitmanTimeLimit, this.startedCommand, this.userJoinCommand, this.hitmanApproachingCommand, this.hitmanAppearsCommand, new GameOutcome("Success", 0, roleProbabilities, this.userSuccessCommand), new GameOutcome("Failure", 0, roleProbabilities, this.userFailCommand)); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public HitmanGameEditorControl(HitmanGameCommand command) : this() { this.existingCommand = command; }