Esempio n. 1
0
 public void SaveDbStaticItem(DbStaticItem DbStaticItem)
 {
     if (DbStaticItem.Id == 0)
     {
         context.DbStaticItems.Add(DbStaticItem);
     }
     else
     {
         var editMe = context.DbStaticItems.Find(DbStaticItem.Id);
         if (editMe != null)
         {
             // dbEntry.Name = DbStaticItem.Name;
             // dbEntry.Message = DbStaticItem.Message;
             // dbEntry.TimeStamp = DbStaticItem.TimeStamp;
         }
     }
     context.SaveChanges();
 }
Esempio n. 2
0
        public void LoadBalanceBox(DbStaticItem input)
        {
            BuffStats = new List <BuffStat>();
            var addme = new BuffStat();

            if (input.Discipline != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Discipline),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Perception != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Perception),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Charisma != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Charisma),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Fortitude != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Fortitude),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Agility != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Agility),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Allure != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Allure),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Magicka != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Magicka),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Succour != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Succour),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }

            if (input.Luck != 0)
            {
                addme = new BuffStat
                {
                    Amount           = Convert.ToDecimal(input.Luck),
                    Value            = 1,
                    NegativeModifier = 0,
                    NegativeCap      = -99999,
                };
                this.BuffStats.Add(addme);
            }
        }