public BeachBallGameEditorControl(BeachBallGameCommand command)
        {
            InitializeComponent();

            this.existingCommand = command;
            this.viewModel       = new BeachBallGameEditorControlViewModel(command);
        }
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            GameCommandBase newCommand = new BeachBallGameCommand(name, triggers, requirements, this.LowerTimeLimit, this.UpperTimeLimit, this.AllowUserTargeting, this.StartedCommand, this.BallHitCommand,
                                                                  this.BallMissedCommand);

            this.SaveGameCommand(newCommand, this.existingCommand);
        }
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            GameCommandBase newCommand = new BeachBallGameCommand(name, triggers, requirements, this.LowerTimeLimit, this.UpperTimeLimit, this.AllowUserTargeting, this.StartedCommand, this.BallHitCommand,
                                                                  this.BallMissedCommand);

            if (this.existingCommand != null)
            {
                ChannelSession.Settings.GameCommands.Remove(this.existingCommand);
                newCommand.ID = this.existingCommand.ID;
            }
            ChannelSession.Settings.GameCommands.Add(newCommand);
        }
        public BeachBallGameEditorControlViewModel(BeachBallGameCommand command)
        {
            this.existingCommand = command;

#pragma warning disable CS0612 // Type or member is obsolete
            if (this.existingCommand.HitTimeLimit > 0)
            {
                this.existingCommand.LowerLimit   = this.existingCommand.HitTimeLimit;
                this.existingCommand.UpperLimit   = this.existingCommand.HitTimeLimit;
                this.existingCommand.HitTimeLimit = 0;
            }
#pragma warning restore CS0612 // Type or member is obsolete

            this.LowerTimeLimit     = this.existingCommand.LowerLimit;
            this.UpperTimeLimit     = this.existingCommand.UpperLimit;
            this.AllowUserTargeting = this.existingCommand.AllowUserTargeting;

            this.StartedCommand    = this.existingCommand.StartedCommand;
            this.BallHitCommand    = this.existingCommand.BallHitCommand;
            this.BallMissedCommand = this.existingCommand.BallMissedCommand;
        }