Example #1
0
        public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
        {
            string typeName = value?.GetType().FullName;
            var    country  = value as Country;

            playerAttributes.RegistrationCountry = country;
        }
Example #2
0
 public void ApplyPositiveTestValues(IPlayerAttributesSimulatorViewModel playerAttributes)
 {
     foreach (var condition in Conditions)
     {
         var testValue = condition.GetPositiveTestValues()?.FirstOrDefault();
         if (testValue != null)
         {
             testValue.ApplyValue(playerAttributes);
         }
     }
 }
Example #3
0
        public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
        {
            var isVip = (bool)value;

            if (isVip)
            {
                playerAttributes.VipLevel = VipLevel.VIP;
            }
            else
            {
                playerAttributes.VipLevel = VipLevel.Regular;
            }
        }
Example #4
0
        public void ApplyTestValues(IPlayerAttributesSimulatorViewModel playerAttributes)
        {
            var positiveValues = new List <TestValue>();

            foreach (var t in _triggers)
            {
                positiveValues.AddRange(t.GetAllPositiveTestValues());
            }

            foreach (var t in _triggers)
            {
                t.ApplyNegativeTestValues(playerAttributes, positiveValues);
            }
        }
Example #5
0
        public void ApplyNegativeTestValues(IPlayerAttributesSimulatorViewModel playerAttributes, IEnumerable <TestValue> positiveValues)
        {
            var positiveValuesPerField = positiveValues.GroupBy(v => v.Field).ToDictionary(f => f.Key, f => f.ToArray());



            foreach (var condition in Conditions)
            {
                var testValue = condition.GetNegativeTestValue(positiveValuesPerField.ContainsKey(condition.Field) ? positiveValuesPerField[condition.Field] : new TestValue[0]);
                if (testValue != null)
                {
                    testValue.ApplyValue(playerAttributes);
                }
            }
        }
Example #6
0
 public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
 {
     playerAttributes.RegistrationDate = (DateTime)value;
 }
Example #7
0
 public abstract void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value);
Example #8
0
        public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
        {
#warning Not Implemented
        }
Example #9
0
 public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
 {
     playerAttributes.Gender = (Gender)value;
 }
Example #10
0
 public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
 {
     playerAttributes.Age = (int)value;
 }
Example #11
0
 public override void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes, object value)
 {
     playerAttributes.RegistrationCurrency = value as CurrencyInfo;
 }
Example #12
0
 public void ApplyTestValues(IPlayerAttributesSimulatorViewModel playerAttributes)
 {
     _trigger.ApplyPositiveTestValues(playerAttributes);
 }
Example #13
0
 public void ApplyValue(IPlayerAttributesSimulatorViewModel playerAttributes)
 {
     Field.ApplyValue(playerAttributes, Value);
 }