public SpinGameEditorControl(SpinGameCommand command) { InitializeComponent(); this.existingCommand = command; this.viewModel = new SpinGameEditorControlViewModel(command); }
public SpinGameEditorControlViewModel(SpinGameCommand command) : this() { this.existingCommand = command; foreach (GameOutcome outcome in this.existingCommand.Outcomes) { this.Outcomes.Add(new SpinOutcome(outcome)); } }
public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements) { GameCommandBase newCommand = new SpinGameCommand(name, triggers, requirements, this.Outcomes.Select(o => o.GetGameOutcome())); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public override void SaveGameCommand() { GameCommandBase newCommand = new SpinGameCommand(this.CommandDetailsControl.GameName, this.CommandDetailsControl.ChatTriggers, this.CommandDetailsControl.GetRequirements(), this.outcomes.Select(o => o.GetGameOutcome())); if (this.existingCommand != null) { ChannelSession.Settings.GameCommands.Remove(this.existingCommand); newCommand.ID = this.existingCommand.ID; } ChannelSession.Settings.GameCommands.Add(newCommand); }
public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements) { GameCommandBase newCommand = new SpinGameCommand(name, triggers, requirements, this.Outcomes.Select(o => o.GetGameOutcome())); this.SaveGameCommand(newCommand, this.existingCommand); }
public SpinGameEditorControl(SpinGameCommand command) : this() { this.existingCommand = command; }