Example #1
0
        public void RemoveCapacity(CapacityType capacityType)
        {
            Capacity capacity = new Capacity(capacityType);

            Capacities.Remove(capacity);

            if (capacityType == CapacityType.WeaponMastery)
            {
                this.WeaponMastery = WeaponTypes.None;
            }
        }
Example #2
0
        public void AddCapacity(CapacityType capacityType)
        {
            if (this.MaxNumberOfCapacities > this.Capacities.Count)
            {
                if (!PossesCapacity(capacityType))
                {
                    Capacity capacity = new Capacity(capacityType);
                    Capacities.Add(capacity);

                    if (capacityType == CapacityType.WeaponMastery)
                    {
                        while (this.WeaponMastery == WeaponTypes.None)
                        {
                            this.WeaponMastery = GlobalFunction.RandomEnumValue <WeaponTypes>();
                        }
                    }
                }
            }
            else
            {
                throw new MaxNumberOfCapacitiesReached(GlobalTranslator.Instance.Translator.ProvideValue("TooManyCapacities") + " (" + MaxNumberOfCapacities + ")");
            }
        }