Beispiel #1
0
        public async Task <FeaturesDto> GetFeaturesAsync(int version = 0)
        {
            var result = new FeaturesDto
            {
                Version = FeatureVersion
            };

            if (client != null && version < FeatureVersion)
            {
                try
                {
                    var query = new ContentQuery
                    {
                        Filter = $"data/version/iv ge {FeatureVersion}"
                    };

                    var features = await client.GetAsync(query, flatten);

                    result.Features = features.Items.Select(x => x.Data).ToList();
                }
                catch
                {
                    result.Features = new List <FeatureDto>();
                }
            }

            result.Features ??= new List <FeatureDto>();

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Initialize the Body
        /// </summary>
        /// <param name="skinnedMeshRenderer"></param>
        public void Initialize(SkinnedMeshRenderer skinnedMeshRenderer, FeaturesDto featuresDto)
        {
            _skinnedMeshRenderer = skinnedMeshRenderer;

            ChangeFeature(FeatureType.EYES, featuresDto.Eyes);
            ChangeFeature(FeatureType.MOUTH, featuresDto.Mouth);
            ChangeFeature(FeatureType.EYEBROW, featuresDto.Eyebrow);
        }
Beispiel #3
0
        public async Task <FeaturesDto> GetFeaturesAsync(int version = 0)
        {
            var result = new FeaturesDto {
                Features = new List <FeatureDto>(), Version = FeatureVersion
            };

            if (client != null && version < FeatureVersion)
            {
                var features = await client.GetAsync(filter : $"data/version/iv ge {FeatureVersion}", context : Flatten);

                result.Features.AddRange(features.Items.Select(x => x.Data));
            }

            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// Initialize the Body
        /// </summary>
        /// <param name="skinnedMeshRenderer"></param>
        public void Initialize(SkinnedMeshRenderer skinnedMeshRenderer, FeaturesDto featuresDto)
        {
            _skinnedMeshRenderer = skinnedMeshRenderer;

            if (ColorUtility.TryParseHtmlString(featuresDto.HairColor, out Color hairColor))
            {
                ChangeCharacteristicColor(Characteristic.HAIR, hairColor);
            }

            if (ColorUtility.TryParseHtmlString(featuresDto.SkinColor, out Color skinColor))
            {
                ChangeCharacteristicColor(Characteristic.SKIN, skinColor);
            }

            if (ColorUtility.TryParseHtmlString(featuresDto.UnderwearColor, out Color underwearColor))
            {
                ChangeCharacteristicColor(Characteristic.UNDERWEAR, underwearColor);
            }
        }
Beispiel #5
0
        public async Task <FeaturesDto> GetFeaturesAsync(int version          = 0,
                                                         CancellationToken ct = default)
        {
            var result = new FeaturesDto
            {
                Version = version
            };

            if (client != null && version < FeatureVersion)
            {
                try
                {
                    var query = new ContentQuery();

                    if (version == 0)
                    {
                        query.Filter = $"data/version/iv eq {FeatureVersion}";
                    }
                    else
                    {
                        query.Filter = $"data/version/iv le {FeatureVersion} and data/version/iv gt {version}";
                    }

                    var features = await client.GetAsync(query, flatten, ct);

                    result.Features.AddRange(features.Items.Select(x => x.Data).ToList());

                    if (features.Items.Count > 0)
                    {
                        result.Version = features.Items.Max(x => x.Version);
                    }
                }
                catch
                {
                }
            }

            return(result);
        }
Beispiel #6
0
 public bool Save([FromBody] FeaturesDto featuresManagementResponse) =>
 _featuresBackend.Init(Log).SaveFeatures(featuresManagementResponse);
Beispiel #7
0
 public bool Save([FromBody] FeaturesDto featuresManagementResponse) =>
 GetService <FeaturesBackend>().Init(Log).SaveFeatures(featuresManagementResponse);
 public bool SaveFeatures([FromBody] FeaturesDto featuresManagementResponse) =>
 Factory.Resolve <FeaturesBackend>().Init(Log).SaveFeatures(featuresManagementResponse);