Esempio n. 1
0
        public HotPotatoGameEditorControl(HotPotatoGameCommand command)
        {
            InitializeComponent();

            this.existingCommand = command;
            this.viewModel       = new HotPotatoGameEditorControlViewModel(command);
        }
Esempio n. 2
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            GameCommandBase newCommand = new HotPotatoGameCommand(name, triggers, requirements, this.LowerTimeLimit, this.UpperTimeLimit, this.AllowUserTargeting, this.StartedCommand, this.TossPotatoCommand,
                                                                  this.PotatoExplodeCommand);

            this.SaveGameCommand(newCommand, this.existingCommand);
        }
Esempio n. 3
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            GameCommandBase newCommand = new HotPotatoGameCommand(name, triggers, requirements, this.LowerTimeLimit, this.UpperTimeLimit, this.AllowUserTargeting, this.StartedCommand, this.TossPotatoCommand,
                                                                  this.PotatoExplodeCommand);

            if (this.existingCommand != null)
            {
                ChannelSession.Settings.GameCommands.Remove(this.existingCommand);
                newCommand.ID = this.existingCommand.ID;
            }
            ChannelSession.Settings.GameCommands.Add(newCommand);
        }
Esempio n. 4
0
        public HotPotatoGameEditorControlViewModel(HotPotatoGameCommand command)
        {
            this.existingCommand = command;

#pragma warning disable CS0612 // Type or member is obsolete
            if (this.existingCommand.TimeLimit > 0)
            {
                this.existingCommand.LowerLimit = this.existingCommand.TimeLimit;
                this.existingCommand.UpperLimit = this.existingCommand.TimeLimit;
                this.existingCommand.TimeLimit  = 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.TossPotatoCommand    = this.existingCommand.TossPotatoCommand;
            this.PotatoExplodeCommand = this.existingCommand.PotatoExplodeCommand;
        }