public CoinPusherGameEditorControl(CoinPusherGameCommand command) { InitializeComponent(); this.existingCommand = command; this.viewModel = new CoinPusherGameEditorControlViewModel(this.existingCommand); }
public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements) { this.PayoutPercentageMinimum = (this.PayoutPercentageMinimum / 100.0); this.PayoutPercentageMaximum = (this.PayoutPercentageMaximum / 100.0); GameCommandBase newCommand = new CoinPusherGameCommand(name, triggers, requirements, this.StatusArgument.ToLower(), this.MinimumAmountForPayout, this.PayoutProbability, this.PayoutPercentageMinimum, this.PayoutPercentageMaximum, this.StatusCommand, this.NoPayoutCommand, this.PayoutCommand); this.SaveGameCommand(newCommand, this.existingCommand); }
public CoinPusherGameEditorControlViewModel(CoinPusherGameCommand command) { this.existingCommand = command; this.MinimumAmountForPayout = this.existingCommand.MinimumAmountForPayout; this.PayoutProbability = this.existingCommand.PayoutProbability; this.PayoutPercentageMinimum = (this.existingCommand.PayoutPercentageMinimum * 100.0); this.PayoutPercentageMaximum = (this.existingCommand.PayoutPercentageMaximum * 100.0); this.StatusArgument = this.existingCommand.StatusArgument; this.StatusCommand = this.existingCommand.StatusCommand; this.NoPayoutCommand = this.existingCommand.NoPayoutCommand; this.PayoutCommand = this.existingCommand.PayoutCommand; }
public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements) { this.PayoutPercentageMinimum = (this.PayoutPercentageMinimum / 100.0); this.PayoutPercentageMaximum = (this.PayoutPercentageMaximum / 100.0); GameCommandBase newCommand = new CoinPusherGameCommand(name, triggers, requirements, this.StatusArgument.ToLower(), this.MinimumAmountForPayout, this.PayoutProbability, this.PayoutPercentageMinimum, this.PayoutPercentageMaximum, this.StatusCommand, this.NoPayoutCommand, this.PayoutCommand); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public override void SaveGameCommand() { int.TryParse(this.MinimumAmountForPayoutTextBox.Text, out int minAmountForPayout); int.TryParse(this.PayoutProbabilityTextBox.Text, out int payoutProbability); double.TryParse(this.PayoutPercentageMinimumLimitTextBox.Text, out double minPayoutPercentage); double.TryParse(this.PayoutPercentageMaximumLimitTextBox.Text, out double maxPayoutPercentage); minPayoutPercentage = minPayoutPercentage / 100.0; maxPayoutPercentage = maxPayoutPercentage / 100.0; GameCommandBase newCommand = new CoinPusherGameCommand(this.CommandDetailsControl.GameName, this.CommandDetailsControl.ChatTriggers, this.CommandDetailsControl.GetRequirements(), this.StatusArgumentTextBox.Text.ToLower(), minAmountForPayout, payoutProbability, minPayoutPercentage, maxPayoutPercentage, this.statusCommand, this.noPayoutCommand, this.payoutCommand); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public CoinPusherGameEditorControl(CoinPusherGameCommand command) : this() { this.existingCommand = command; }