protected ParameterConditional(ParameterValueHolder <int> compared, ParameterValueHolder <int> compareTo, WarningType warningType, string description = null)
 {
     Compared    = compared;
     CompareTo   = compareTo;
     WarningType = warningType;
     Description = description;
 }
Ejemplo n.º 2
0
        public SmartTarget(int id) : base(id)
        {
            Position = new ParameterValueHolder <float> [4];

            Position[0] = new ParameterValueHolder <float>("Target X", FloatParameter.Instance, 0);
            Position[1] = new ParameterValueHolder <float>("Target Y", FloatParameter.Instance, 0);
            Position[2] = new ParameterValueHolder <float>("Target Z", FloatParameter.Instance, 0);
            Position[3] = new ParameterValueHolder <float>("Target O", FloatParameter.Instance, 0);

            for (var i = 0; i < 4; ++i)
            {
                Position[i].PropertyChanged += (_, _) => CallOnChanged();
            }
        }
Ejemplo n.º 3
0
        public SmartEvent(int id) : base(SmartEventParamsCount, id)
        {
            Actions    = new ObservableCollection <SmartAction>();
            Conditions = new ObservableCollection <SmartCondition>();

            Actions.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (SmartAction ob in args.NewItems !)
                    {
                        ob.Parent = this;
                    }
                }
            };
            Conditions.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (SmartCondition ob in args.NewItems !)
                    {
                        ob.Parent = this;
                    }
                }
            };

            flags       = new ParameterValueHolder <long>("Flags", SmartEventFlagParameter.Instance, 0);
            chance      = new ParameterValueHolder <long>("Chance", Parameter.Instance, 0);
            phases      = new ParameterValueHolder <long>("Phases", SmartEventPhaseParameter.Instance, 0);
            cooldownMin = new ParameterValueHolder <long>("Cooldown min", Parameter.Instance, 0);
            cooldownMax = new ParameterValueHolder <long>("Cooldown max", Parameter.Instance, 0);

            flags.PropertyChanged  += (_, _) => CallOnChanged();
            chance.PropertyChanged += (_, _) =>
            {
                CallOnChanged();
                OnPropertyChanged(nameof(ChanceString));
            };
            phases.PropertyChanged      += (_, _) => CallOnChanged();
            cooldownMin.PropertyChanged += (_, _) => CallOnChanged();
            cooldownMax.PropertyChanged += (_, _) => CallOnChanged();
        }
Ejemplo n.º 4
0
        public SmartAction(int id, SmartSource source, SmartTarget target) : base(SmartActionParametersCount, id)
        {
            if (source == null || target == null)
            {
                throw new ArgumentNullException("Source or target is null");
            }

            this.source              = source;
            this.target              = target;
            source.OnChanged        += SourceOnOnChanged;
            target.OnChanged        += SourceOnOnChanged;
            comment                  = new ParameterValueHolder <string>("Comment", new StringParameter());
            comment.PropertyChanged += (_, _) =>
            {
                CallOnChanged();
                OnPropertyChanged(nameof(Comment));
            };

            Context.Add(new MetaSmartSourceTargetEdit(this, true));
            Context.Add(new MetaSmartSourceTargetEdit(this, false));
        }
Ejemplo n.º 5
0
 public SmartSource(int id) : base(SmartSourceParametersCount, id)
 {
     condition = new ParameterValueHolder <int>("Condition ID", Parameter.Instance);
 }
Ejemplo n.º 6
0
 public SmartSource(int id) : base(SmartSourceParametersCount, id, that => new SmartScriptParameterValueHolder(Parameter.Instance, 0, that))
 {
     condition = new ParameterValueHolder <long>("Condition ID", Parameter.Instance, 0);
 }
 protected ParameterConditional(ParameterValueHolder <int> compared, WarningType warningType)
 {
     Compared    = compared;
     WarningType = warningType;
 }