Exemplo n.º 1
0
 protected override void ExecuteAddSupplementCommand(string[] commandWords)
 {
     Unit targetUnit = null;
     switch (commandWords[1])
     {
         case "PowerCatalyst":
             var powerCatalyst = new PowerCatalyst();
             targetUnit = GetUnit(commandWords[2]);
             targetUnit.AddSupplement(powerCatalyst);
             break;
         case "HealthCatalyst":
             var healthCatalyst = new HealthCatalyst();
             targetUnit = GetUnit(commandWords[2]);
             targetUnit.AddSupplement(healthCatalyst);
             break;
         case "AggressionCatalyst":
             var aggressionCatalyst = new AggressionCatalyst();
             targetUnit = GetUnit(commandWords[2]);
             targetUnit.AddSupplement(aggressionCatalyst);
             break;
         case "Weapon":
             var weapon = new Weapon();
             targetUnit = GetUnit(commandWords[2]);
             targetUnit.AddSupplement(weapon);
             break;
         default:
             break;
     }
 }
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            string supplementId = commandWords[1];
            string id = commandWords[2];

            var unitForAdding = this.GetUnit(id);
            ISupplement supplement = null;
            switch (supplementId)
            {
                case "AggressionCatalyst":
                    supplement =  new AggressionCatalyst();
                    break;
                case "Weapon":
                   supplement =  new Weapon();
                    break;
                case "PowerCatalyst":
                    supplement = new PowerCatalyst();
                    break;
                case "HealthCatalyst":
                    supplement = new HealthCatalyst();
                    break;
                default:
                    break;
            }

            unitForAdding.AddSupplement(supplement);
        }
Exemplo n.º 3
0
 protected virtual void ExecuteAddSupplementCommand(string[] commandWords)
 {
     var unit = this.GetUnit(commandWords[2]); ;
     switch (commandWords[1])
     {
         case "PowerCatalyst":
             var powerCatalyst = new PowerCatalyst();
             unit.AddSupplement(powerCatalyst);
             break;
         case "HealthCatalyst":
             var healthCatalyst = new HealthCatalyst();
             unit.AddSupplement(healthCatalyst);
             break;
         case "AggressionCatalyst":
             var aggressionCatalyst = new AggressionCatalyst();
             unit.AddSupplement(aggressionCatalyst);
             break;
         case "WeaponrySkill":
             var weaponrySkill = new WeaponrySkill();
             unit.AddSupplement(weaponrySkill);
             break;
         case "Weapon":
             var weapon = new Weapon();
             unit.AddSupplement(weapon);
             break;
         default:
             break;
     }
 }
Exemplo n.º 4
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            Supplement supplement = null;

            switch (commandWords[1])
            {
            case "Weapon":
                supplement = new Weapon();
                break;

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

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

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

            default:
                break;
            }

            if (supplement != null)
            {
                var targetUnit = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(supplement);
            }
        }
Exemplo n.º 5
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            Supplement supplement = null;

            switch (commandWords[1])
            {
                case "Weapon":
                    supplement = new Weapon();
                    break;
                case "HealthCatalyst":
                    supplement = new HealthCatalyst();
                    break;
                case "PowerCatalyst":
                    supplement = new PowerCatalyst();
                    break;
                case "AggressionCatalyst":
                    supplement = new AggressionCatalyst();
                    break;
                default:
                    break;
            }

            if (supplement != null)
            {
                var targetUnit = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(supplement);
            }
        }
Exemplo n.º 6
0
        public void ReturnCorrecAggressionValue_WhenAggressionChangingSupplementIsAdded()
        {
            var unit = new Tank("Panzer");

            var aggressionCatalyst = new AggressionCatalyst();

            unit.AddSupplement(aggressionCatalyst);

            Assert.AreEqual(28, unit.Aggression);
        }
Exemplo n.º 7
0
        public void RetudsarnCorrectPowerEffect_WhenReactToOtherSupplement()
        {
            var spores = new InfestationSpores();

            var supplementToReact = new AggressionCatalyst();

            spores.ReactTo(supplementToReact);

            Assert.AreEqual(-1, spores.PowerEffect);
        }
Exemplo n.º 8
0
        public void CreateAnInstance()
        {
            var aggressionCatalust = new AggressionCatalyst();

            Assert.IsInstanceOf(typeof(AggressionCatalyst), aggressionCatalust);
        }