コード例 #1
0
        public void DoActionClean(ActionOption actionOption)
        {
            this.CleaningLevel += actionOption.OptionEffect;
            History h = new History()
            {
                PetId        = this.PetId,
                TimeOfAction = DateTime.Now,
                OptionId     = actionOption.OptionId,
                LifeCycleId  = this.LifeCycleId,
                LifeStatusId = this.LifeStatusId
            };

            UIMain.db.AddHistory(h);
            UIMain.db.SaveChanges();
        }
コード例 #2
0
        public void feed(ActionOption a)
        {
            this.HungerLevel += a.OptionEffect;
            History h = new History()
            {
                PetId        = this.PetId,
                TimeOfAction = DateTime.Now,
                OptionId     = a.OptionId,
                LifeCycleId  = this.LifeCycleId,
                LifeStatusId = this.LifeStatusId
            };

            UIMain.db.AddHistory(h);
            this.CleaningLevel = this.CleaningLevel - (a.OptionEffect / 2);
            UIMain.db.SaveChanges();
        }