コード例 #1
0
        public void UpdateWith(IncubatorViewModel incuModel)
        {
            InUse         = incuModel.PokemonId > 0;
            PokemonId     = incuModel.PokemonId;
            UsesRemaining = incuModel.UsesRemaining;
            KM            = incuModel.KM;
            TotalKM       = incuModel.TotalKM;

            RaisePropertyChanged("InUse");
            RaisePropertyChanged("PokemonId");
            RaisePropertyChanged("UsesRemaining");
            RaisePropertyChanged("TotalKM");
            RaisePropertyChanged("KM");
        }
コード例 #2
0
        private void AddOrUpdateIncubator(EggIncubator incu)
        {
            var incuModel = new IncubatorViewModel(incu);
            var existing  = Incubators.FirstOrDefault(x => x.Id == incu.Id);

            if (existing != null)
            {
                existing.UpdateWith(incuModel);
            }
            else
            {
                Incubators.Add(incuModel);
            }
        }
コード例 #3
0
        public void AddOrUpdate(PokemonData egg, IncubatorViewModel incu = null)
        {
            var eggModel = new EggViewModel(egg);

            eggModel.Hatchable = incu == null;

            var existing = this.Eggs.FirstOrDefault(x => x.Id == eggModel.Id);

            if (existing != null)
            {
                existing.UpdateWith(eggModel);
            }
            else
            {
                this.Eggs.Add(eggModel);
            }
        }
コード例 #4
0
        public void AddOrUpdate(PokemonData egg, IncubatorViewModel incu = null)
        {
            var eggModel = new EggViewModel(egg);

            eggModel.Hatchable = incu == null;

            var existing = Eggs.FirstOrDefault(x => x.Id == eggModel.Id);

            if (existing != null)
            {
                // Do not update, it overwrites OnEggIncubatorStatus Status updates
                // existing.UpdateWith(eggModel);
            }
            else
            {
                Eggs.Add(eggModel);
            }
        }