Ejemplo n.º 1
0
 public DetailDataViewModel(IDOLView idol, IDOLDeviation deviation)
 {
     Record  = new DetailData(idol, deviation);
     Records = new List <DetailData> {
         Record
     };
     index                = 0;
     BuckButtonEnabled    = new ReactiveProperty <bool>(false);
     ForwardButtonEnabled = new ReactiveProperty <bool>(false);
 }
Ejemplo n.º 2
0
        public DetailData(IDOLView idol, IDOLDeviation deviation)
        {
            if (idol is null)
            {
                return;
            }

            MasterIDOL = idol;
            var idolList = Model.IDOLList;

            if (deviation != null)
            {
                var tikaiList = Model.IDOLDeviations.Similarity(deviation).OrderBy(x => x.Score).Where(x => x.Name != deviation.Name).Take(5);
                SimDatas = tikaiList.Select(x => new SimData(x.Name, x.Score)).ToList();
            }

            IEnumerable <RankData> rankDatas()
            {
                yield return(new RankData(nameof(idol.Age), idol, deviation?.AgeScore, x => x.Age));

                yield return(new RankData(nameof(idol.Height), idol, deviation?.HeightScore, x => x.Height));

                yield return(new RankData(nameof(idol.Weight), idol, deviation?.WeightScore, x => x.Weight));

                yield return(new RankData(nameof(idol.Bust), idol, deviation?.BustScore, x => x.Bust));

                yield return(new RankData(nameof(idol.Waist), idol, deviation?.WaistScore, x => x.Waist));

                yield return(new RankData(nameof(idol.Hip), idol, deviation?.HipScore, x => x.Hip));

                yield return(new RankData(nameof(idol.BMI), idol, deviation?.BMIScore, x => x.BMI));

                yield return(new RankData(nameof(idol.Under), idol, deviation?.UnderScore, x => x.Under));

                yield return(new RankData(nameof(idol.Diffe), idol, deviation?.DiffScore, x => x.Diffe));
            }

            RankDatas = rankDatas().ToList();

            UnitList = Model.UnitList
                       .Where(x => x.Members.Any(y => MasterIDOL == y))
                       .Select(x => new UnitData()
            {
                Name = x.Name, Member = x.Members.Count
            }).ToList();
        }
Ejemplo n.º 3
0
            public QuizData(IDOLDeviation dev, IDOLView idol)
            {
                name      = dev.Name;
                phonethic = dev.Phonetic;
                Age       = dev.AgeScore;
                Height    = dev.HeightScore;
                Weight    = dev.WeightScore;
                Bust      = dev.BustScore;
                Waist     = dev.WaistScore;
                Hip       = dev.HipScore;
                Score     = Math.Round(300 / dev.TotalScore, 2, MidpointRounding.AwayFromZero);

                birthPlace = idol.BirthPlace;
                birthDay   = idol.BirthDay;
                blood      = idol.Blood;

                IsHint   = false;
                IsAnswer = false;
            }
Ejemplo n.º 4
0
        public RankData(string name, IDOLView idol, double?score, Func <IDOLView, double> selector)
        {
            Name  = name;
            Param = selector(idol);
            Score = score;
            var rank  = Model.IDOLList.Count(x => selector(x) > Param) + 1;
            var count = Model.IDOLList.Count(x => selector(x) != 0);

            if (Param == 0)
            {
                Rank = 0 + "/" + 0;
            }
            else if (rank > count)
            {
                Rank = count.ToString() + "/" + count.ToString();
            }
            else
            {
                Rank = rank.ToString() + "/" + count.ToString();
            }
        }
Ejemplo n.º 5
0
            public ScatterPlot(IDOLView idol)
            {
                IEnumerable <(string key, double value)> f()
                {
                    yield return(nameof(idol.Height), idol.Height);

                    yield return(nameof(idol.Weight), idol.Weight);

                    yield return(nameof(idol.Bust), idol.Bust);

                    yield return(nameof(idol.Waist), idol.Waist);

                    yield return(nameof(idol.Hip), idol.Hip);

                    yield return(nameof(idol.Diffe), idol.Diffe);

                    yield return(nameof(idol.Age), idol.Age);
                }

                Param = f().ToDictionary(key => key.key, value => value.value);
                Blood = idol.Blood;
                Work  = idol.Work;
                Name  = idol.Name;
            }