Beispiel #1
0
        public void Save(CharacterContext context)
        {
            if (saveMask == AmpSaveMask.None)
            {
                return;
            }

            var model = new CharacterActionSetAmp
            {
                Id        = actionSet.Owner,
                SpecIndex = actionSet.Index,
                AmpId     = (byte)Entry.Id
            };

            if ((saveMask & AmpSaveMask.Create) != 0)
            {
                context.Add(model);
            }
            else if ((saveMask & AmpSaveMask.Delete) != 0)
            {
                context.Entry(model).State = EntityState.Deleted;
            }

            saveMask = AmpSaveMask.None;
        }
Beispiel #2
0
        /// <summary>
        /// Add AMP to <see cref="ActionSet"/> from an existing database model.
        /// </summary>
        public void AddAmp(CharacterActionSetAmp model)
        {
            EldanAugmentationEntry entry = GameTableManager.Instance.EldanAugmentation.GetEntry(model.AmpId);

            if (entry == null)
            {
                throw new ArgumentException();
            }

            checked
            {
                AmpPoints -= (byte)entry.PowerCost;
            }

            amps.Add(model.AmpId, new ActionSetAmp(this, entry, false));
        }