public SlotMachineGameEditorControl(SlotMachineGameCommand command) { InitializeComponent(); this.existingCommand = command; this.viewModel = new SlotMachineGameEditorControlViewModel(command); }
public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements) { List <string> symbolsList = new List <string>(this.Symbols.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)); GameCommandBase newCommand = new SlotMachineGameCommand(name, triggers, requirements, this.Outcomes.Select(o => o.GetGameOutcome()), symbolsList, this.FailureOutcomeCommand); this.SaveGameCommand(newCommand, this.existingCommand); }
public SlotMachineGameEditorControlViewModel(SlotMachineGameCommand command) : this() { this.existingCommand = command; this.Symbols = string.Join(" ", this.existingCommand.AllSymbols); this.FailureOutcomeCommand = this.existingCommand.FailureOutcomeCommand; foreach (GameOutcome outcome in this.existingCommand.Outcomes) { this.Outcomes.Add(new SlotMachineOutcome((SlotsGameOutcome)outcome)); } }
public override void SaveGameCommand() { List <string> symbolsList = new List <string>(this.SymbolsTextBox.Text.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)); GameCommandBase newCommand = new SlotMachineGameCommand(this.CommandDetailsControl.GameName, this.CommandDetailsControl.ChatTriggers, this.CommandDetailsControl.GetRequirements(), this.outcomes.Select(o => o.GetGameOutcome()), symbolsList, this.failureOutcomeCommand); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public SlotMachineGameEditorControl(SlotMachineGameCommand command) : this() { this.existingCommand = command; }