Example #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);
            }
        }
Example #3
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is InfestationSpores)
     {
         this.hasEffect = false;
     }
 }
Example #4
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.hasEffect = true;
     }
 }
Example #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;
     }
 }
Example #7
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == ReactionSupplement)
     {
         this.powerEffect = PowerEffectModifier;
         this.aggressionEffect = AggressionEffectModifier;
     }
 }
Example #8
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         _powerEffect      = 10;
         _aggressionEffect = 3;
     }
 }
Example #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);
 }
Example #11
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.powerEffect      = 10;
         this.aggressionEffect = 3;
     }
 }
Example #12
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType() == typeof(WeaponrySkill))
     {
         this.powerEffect      += 10;
         this.aggressionEffect += 3;
     }
 }
Example #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;
     }
 }
Example #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;
     }
 }
Example #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;
     }
 }
Example #20
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType() == typeof(InfestationSpores))
     {
         this.powerEffect      = 0;
         this.aggressionEffect = 0;
     }
 }
Example #21
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     var weaponrySkill = otherSupplement as WeaponrySkill;
     if (weaponrySkill != null)
     {
         this.isActive = true;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     //if (otherSupplement is AggressionCatalyst)//.GetType().Name == "Weapon")
     //{
     //    AggressionCatalyst supplement = otherSupplement as AggressionCatalyst;
     //    supplement.AggressionEffect += CatalystAggression;
     //}
 }
Example #23
0
 public void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = 10;
         this.AggressionEffect = 3;
     }
 }
Example #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;
     }
 }
 public override void ReactTo(ISupplement otherSupplement)
 {
     var infestationSpore = otherSupplement as InfestationSpores;
     if (infestationSpore != null && infestationSpore.isActive)
     {
         this.isActive = false;
     }
 }
Example #28
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == ReactionSupplement)
     {
         this.powerEffect      = PowerEffectModifier;
         this.aggressionEffect = AggressionEffectModifier;
     }
 }
Example #29
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      = WeaponPowerEffect;
         this.AggressionEffect = WeaponAggressionEffect;
     }
 }
Example #30
0
 public override void ReactTo1(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         base.powerEffect      += 10;
         base.aggressionEffect += 3;
     }
 }
 private void AddSupplementToUnit(string unitId, ISupplement supplement)
 {
     var unit = this.GetUnit(unitId);
     if (unit != null)
     {
         unit.AddSupplement(supplement);
     }
 }
Example #32
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement.GetType().Name == "InfestationSpores")
     {
         this.AggressionEffect = 0;
         this.HealthEffect     = 0;
         this.PowerEffect      = 0;
     }
 }
Example #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;
     }
 }
Example #35
0
        public override void ReactTo(ISupplement otherSupplement)
        {
            var weaponrySkill = otherSupplement as WeaponrySkill;

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

            this.supplements.Add(newSupplement);
        }
Example #38
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if(otherSupplement is WeaponrySkill)
     {
         this.PowerEffect = Weapon.WeapPower;
         this.AggressionEffect = Weapon.WeapAggression;
         this.HealthEffect = Weapon.WeapHealth;
     }
 }
Example #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);
        }
        public override void ReactTo(ISupplement otherSupplement)
        {
            var infestationSpore = otherSupplement as InfestationSpores;

            if (infestationSpore != null && infestationSpore.isActive)
            {
                this.isActive = false;
            }
        }
Example #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());
        }
Example #42
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (otherSupplement is WeaponrySkill)
     {
         this.PowerEffect      += Weapon.WeaponActivatedPower;
         this.AggressionEffect += Weapon.WeaponActivatedAggression;
     }
     else
     {
         base.ReactTo(otherSupplement);
     }
 }
Example #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));
        }
Example #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;
     }
 }
Example #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;
Example #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);
        }
Example #47
0
 public override void AddSupplement(ISupplement newSupplement)
 {
     base.AddSupplement(newSupplement);
 }
Example #48
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     base.ReactTo(otherSupplement);
 }
Example #49
0
 public abstract void ReactTo(ISupplement otherSupplement);
Example #50
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     if (!(otherSupplement is WeaponrySkill)) return;
     base.AggressionEffect = 3;
     base.PowerEffect = 10;
 }
Example #51
0
 public virtual void ReactTo(ISupplement otherSupplement)
 {
     //           throw new NotImplementedException();
 }
Example #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);
        }
Example #54
0
 public override void ReactTo(ISupplement otherSupplement)
 {
 }
Example #55
0
 public override void ReactTo(ISupplement otherSupplement)
 {
     throw new System.NotImplementedException();
 }
Example #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)
     };
 }
Example #57
0
 public virtual void ReactTo(ISupplement otherSupplement)
 {
     this.AggressionEffect += otherSupplement.AggressionEffect;
     this.HealthEffect += otherSupplement.HealthEffect;
     this.PowerEffect += otherSupplement.PowerEffect;
 }