Пример #1
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.hasEffect = true;
     }
 }
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            var supplementType = commandWords[1];

            ISupplement supplement = null;

            switch (supplementType)
            {
            case "AggressionCatalyst": supplement = new AggressionCatalyst();
                break;

            case "PowerCatalyst": supplement = new PowerCatalyst();
                break;

            case "HealthCatalyst": supplement = new HealthCatalyst();
                break;

            case "Weapon": supplement = new Weapon();
                break;

            default: break;
            }

            var unitId = commandWords[2];
            var unit   = this.GetUnit(unitId);

            if (unit != null)
            {
                unit.AddSupplement(supplement);
            }
        }
Пример #3
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.hasEffect = false;
     }
 }
Пример #4
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.hasEffect = true;
     }
 }
Пример #5
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.hasEffect = false;
     }
 }
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.powerEffect = 0;
         this.aggressionEffect = 0;
     }
 }
Пример #7
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == ReactionSupplement)
     {
         this.powerEffect = PowerEffectModifier;
         this.aggressionEffect = AggressionEffectModifier;
     }
 }
Пример #8
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         _powerEffect      = 10;
         _aggressionEffect = 3;
     }
 }
Пример #9
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == "WeaponrySkill")
     {
         this.PowerEffect      = 10;
         this.AggressionEffect = 3;
     }
 }
 //Adds supplement to user's supplement list.
 public void AddSupplement(ISupplement supplement)
 {
     if (supplement == null)
     {
         throw new ArgumentException("Supplement cannot be null.");
     }
     this.supplements.Add(supplement);
 }
Пример #11
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.powerEffect      = 10;
         this.aggressionEffect = 3;
     }
 }
Пример #12
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType() == typeof(WeaponrySkill))
     {
         this.powerEffect      += 10;
         this.aggressionEffect += 3;
     }
 }
Пример #13
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.aggressionEffect = 0;
         this.powerEffect      = 0;
     }
 }
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill && this.powerEffect == 0 && this.aggressionEffect == 0)
     {
         this.powerEffect = 10;
         this.aggressionEffect = 3;
     }
 }
Пример #15
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = Weapon.GeneralPowerEffect;
         this.AggressionEffect = Weapon.GeneralAgressionIncrease;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == "InfestationSpores")
     {
         this.AggressionEffect = 0;
         this.PowerEffect = 0;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.PowerEffect      = 0;
         this.AggressionEffect = 0;
     }
 }
Пример #18
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == this.GetType().Name)
     {
         this.AggressionEffectConst = 0;
         this.PowerEffectConst      = 0;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.PowerEffect = 0;
         this.AggressionEffect = 0;
     }
 }
Пример #20
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType() == typeof(InfestationSpores))
     {
         this.powerEffect      = 0;
         this.aggressionEffect = 0;
     }
 }
Пример #21
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     var weaponrySkill = otherSupplement as WeaponrySkill;
     if (weaponrySkill != null)
     {
         this.isActive = true;
     }
 }
Пример #22
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     //if (otherSupplement is AggressionCatalyst)//.GetType().Name == "Weapon")
     //{
     //    AggressionCatalyst supplement = otherSupplement as AggressionCatalyst;
     //    supplement.AggressionEffect += CatalystAggression;
     //}
 }
Пример #23
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = 10;
         this.AggressionEffect = 3;
     }
 }
Пример #24
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect = Weapon.WeaponPotentialPowerEffect;
         this.AggressionEffect = Weapon.WeaponPotentialAggressionEffect;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect = 10;
         this.AggressionEffect = 3;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == "WeaponrySkill")
     {
         this.AggressionEffect = 3;
         this.PowerEffect = 10;
     }
 }
Пример #27
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     var infestationSpore = otherSupplement as InfestationSpores;
     if (infestationSpore != null && infestationSpore.isActive)
     {
         this.isActive = false;
     }
 }
Пример #28
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == ReactionSupplement)
     {
         this.powerEffect      = PowerEffectModifier;
         this.aggressionEffect = AggressionEffectModifier;
     }
 }
Пример #29
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = WeaponPowerEffect;
         this.AggressionEffect = WeaponAggressionEffect;
     }
 }
Пример #30
0
 public override void ReactTo1(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         base.powerEffect      += 10;
         base.aggressionEffect += 3;
     }
 }
Пример #31
0
 private void AddSupplementToUnit(string unitId, ISupplement supplement)
 {
     var unit = this.GetUnit(unitId);
     if (unit != null)
     {
         unit.AddSupplement(supplement);
     }
 }
Пример #32
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == "InfestationSpores")
     {
         this.AggressionEffect = 0;
         this.HealthEffect     = 0;
         this.PowerEffect      = 0;
     }
 }
Пример #33
0
 public override void ReactTo1(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         var a = (Supplement)otherSupplement;
         a.aggressionEffect = 0;
         a.powerEffect      = 0;
     }
 }
 public void ReactTo(ISupplement otherSupplement)
 {
     //impl : Supplement does not accumulate
     if (otherSupplement is InfestationSpores)
     {
         _powerEffect      = 0;
         _aggressionEffect = 0;
     }
 }
Пример #35
0
        public override void ReactTo(ISupplement otherSupplement)
        {
            var weaponrySkill = otherSupplement as WeaponrySkill;

            if (weaponrySkill != null)
            {
                this.isActive = true;
            }
        }
Пример #36
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = Weapon.WeapPower;
         this.AggressionEffect = Weapon.WeapAggression;
         this.HealthEffect     = Weapon.WeapHealth;
     }
 }
Пример #37
0
        public virtual void AddSupplement(ISupplement newSupplement)
        {
            foreach (var supplement in this.supplements)
            {
                newSupplement.ReactTo(supplement);
            }

            this.supplements.Add(newSupplement);
        }
Пример #38
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if(otherSupplement is WeaponrySkill)
     {
         this.PowerEffect = Weapon.WeapPower;
         this.AggressionEffect = Weapon.WeapAggression;
         this.HealthEffect = Weapon.WeapHealth;
     }
 }
Пример #39
0
        protected void InsertSupplyment(ISupplement supplyment, string id)
        {
            var unit = this.containedUnits
                       .Where(u => u.Id == id)
                       .Select(u => u as Human)
                       .First();

            unit.AddSupplement(supplyment);
        }
Пример #40
0
        public override void ReactTo(ISupplement otherSupplement)
        {
            var infestationSpore = otherSupplement as InfestationSpores;

            if (infestationSpore != null && infestationSpore.isActive)
            {
                this.isActive = false;
            }
        }
Пример #41
0
        private string CreateQuery(ISupplement suppement)
        {
            var query = new StringBuilder();

            if (suppement.SupplementId != 0)
            {
                query.Append($"WHERE SupplementId={suppement.SupplementId}");
            }

            if (suppement.SupplementName != null && !suppement.SupplementName.Equals(string.Empty))
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"SupplementName LIKE N'%{suppement.SupplementName}%'");
            }

            if (suppement.SupplementWeight != 0)
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"SupplementWeight ={suppement.SupplementWeight}");
            }

            if (suppement.SupplementPrice != 0)
            {
                if (query.Length == 0)
                {
                    query.Append("WHERE ");
                }
                else
                {
                    query.Append(" AND ");
                }

                query.Append($"SupplementPrice={suppement.SupplementPrice}");
            }

            return(query.ToString());
        }
Пример #42
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      += Weapon.WeaponActivatedPower;
         this.AggressionEffect += Weapon.WeaponActivatedAggression;
     }
     else
     {
         base.ReactTo(otherSupplement);
     }
 }
Пример #43
0
        public int Count(ISupplement searchSupplement)
        {
            string query = string.Empty;

            if (searchSupplement != null)
            {
                query = CreateQuery(searchSupplement);
            }

            return(_context.ExecuteScalar <int>(@"
                    SELECT COUNT(SupplementId)       
                    FROM 
                        Supplements
                    " + query));
        }
Пример #44
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect = Weapon.WeaponPowerEffect;
         this.HealthEffect = Weapon.WeaponHealthEffect;
         this.AggressionEffect = Weapon.WeaponAggressionEffect;
     }
     else
     {
         // Weapon.ReactTo(WeaponrySkill);
         this.PowerEffect = 0;
         this.HealthEffect = 0;
         this.AggressionEffect = 0;
     }
 }
Пример #45
0
 public bool UpdateSupplement(ISupplement updateSupplement) =>
 _context.Execute(@"
             UPDATE
                 Supplements
             SET
                 SupplementName         = @supplementname
                 ,SupplementDescription = @supplementdescription
                 ,SupplementPrice       = @supplementprice
                 ,SupplementWeight      = @supplementweight
             WHERE
                 SupplementId           = @supplementid
         ", new
 {
     supplementid          = updateSupplement.SupplementId,
     supplementname        = updateSupplement.SupplementName,
     supplementdescription = updateSupplement.SupplementDescription,
     supplementprice       = updateSupplement.SupplementPrice,
     supplementweight      = updateSupplement.SupplementWeight
 }) != 0;
Пример #46
0
        public bool InsertSupplement(ISupplement supplement)
        {
            supplement.SupplementId = GetIdForNextSupplement();

            if (supplement.SupplementId == 0)
            {
                supplement.SupplementId++;
            }

            return(_context.Execute(@"
                    INSERT
                        Supplements(SupplementId, SupplementName, SupplementDescription, SupplementPrice, SupplementWeight)
                    VALUES
                        (@supplementid, @supplementname, @supplementdescription, @supplementprice, @supplementweight)
                ", new
            {
                supplementid = supplement.SupplementId,
                supplementname = supplement.SupplementName,
                supplementdescription = supplement.SupplementDescription,
                supplementprice = supplement.SupplementPrice,
                supplementweight = supplement.SupplementWeight
            }) != 0);
        }
Пример #47
0
 public override void AddSupplement(ISupplement newSupplement)
 {
     base.AddSupplement(newSupplement);
 }
Пример #48
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     base.ReactTo(otherSupplement);
 }
Пример #49
0
 public abstract void ReactTo(ISupplement otherSupplement);
Пример #50
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (!(otherSupplement is WeaponrySkill)) return;
     base.AggressionEffect = 3;
     base.PowerEffect = 10;
 }
Пример #51
0
 public virtual void ReactTo(ISupplement otherSupplement)
 {
     //           throw new NotImplementedException();
 }
Пример #52
0
 public virtual void ReactTo(ISupplement otherSupplement)
 {
 }
        public virtual void AddSupplement(ISupplement newSupplement)
        {
            foreach (var supplement in this.supplements)
            {
                newSupplement.ReactTo(supplement);
            }

            this.supplements.Add(newSupplement);
        }
Пример #54
0
 public override void ReactTo(ISupplement otherSupplement)
 {
 }
Пример #55
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     throw new System.NotImplementedException();
 }
Пример #56
0
 public static SupplementDTO Convert(ISupplement supplement)
 {
     return new SupplementDTO()
     {
         Id = supplement.Id,
         IsHourCanceled = supplement.IsHourCanceled,
         Hour = Convert(supplement.Hour),
         Schedule = Convert(supplement.Schedule),
         Teacher = supplement.Teacher == null ? null : Convert(supplement.Teacher)
     };
 }
Пример #57
0
 public virtual void ReactTo(ISupplement otherSupplement)
 {
     this.AggressionEffect += otherSupplement.AggressionEffect;
     this.HealthEffect += otherSupplement.HealthEffect;
     this.PowerEffect += otherSupplement.PowerEffect;
 }