예제 #1
0
파일: TiedOption.cs 프로젝트: slb1988/agame
        public override void ChangeModifierConfig(ConfigAbilityModifier modifier)
        {
            AvatarTiedMixin element = new AvatarTiedMixin {
                UntieSteerAmount = this.UntieSteerAmount
            };

            Miscs.ArrayAppend <ConfigAbilityMixin>(ref modifier.ModifierMixins, element);
        }
예제 #2
0
        public override void ChangeModifierConfig(ConfigAbilityModifier modifier)
        {
            ModifyDamageByAttackeeMixin element = new ModifyDamageByAttackeeMixin {
                AddedDamageTakeRatio = this.TakeExtraDamageRatio,
                Predicates           = new ConfigAbilityPredicate[0]
            };

            Miscs.ArrayAppend <ConfigAbilityMixin>(ref modifier.ModifierMixins, element);
        }
예제 #3
0
        public override void ChangeModifierConfig(ConfigAbilityModifier modifier)
        {
            modifier.ThinkInterval = this.BleedCD;
            DamageByAttackValue element = new DamageByAttackValue {
                Target           = AbilityTargetting.Self,
                DamagePercentage = this.DamagePercentage,
                AddedDamageValue = this.BleedDamage
            };

            Miscs.ArrayAppend <ConfigAbilityAction>(ref modifier.OnThinkInterval, element);
        }
 public void SetImage(HalconDotNet.HImage img)
 {
     try
     {
         Miscs.HImageToBitmap(img, out Bitmap);
         pictureZoom.Bmp = Bitmap;
         pictureZoom.FitDisplay();
     }
     catch (Exception ex)
     {
         MessageBox.Show("载入图片失败:" + ex.Message);
     }
 }
예제 #5
0
        public void Miscs_Valid_NonEmpty()
        {
            Miscs miscs = new Miscs();

            Mock <Misc> misc = GetMockMisc();

            misc.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true);

            miscs.Add(misc.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

            // need to suppress the type check because moq uses a different type
            Assert.IsTrue(miscs.IsValidRecordSet(ref errorCode, suppressTypeCheck: true));
        }
예제 #6
0
        public void Miscs_Invalid_BadType()
        {
            Miscs miscs = new Miscs();

            Mock <Misc> misc = GetMockMisc();

            misc.Setup(s => s.IsValid(ref It.Ref <ValidationCode> .IsAny)).Returns(true);

            miscs.Add(misc.Object);

            ValidationCode errorCode = ValidationCode.SUCCESS;

            // do not suppress type check. Since moq uses a different type anyway,
            // there is no need to test with a different IRecord type
            Assert.IsFalse(miscs.IsValidRecordSet(ref errorCode, suppressTypeCheck: false));
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Recipe"/> class.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="style">The style.</param>
        /// <param name="brewer">The brewer.</param>
        /// <param name="batchSize">Size of the batch.</param>
        /// <param name="boilSize">Size of the boil.</param>
        /// <param name="boilTime">The boil time.</param>
        /// <param name="hops">The hops.</param>
        /// <param name="fermentables">The fermentables.</param>
        /// <param name="miscs">The miscs.</param>
        /// <param name="yeasts">The yeasts.</param>
        /// <param name="waters">The waters.</param>
        /// <param name="mash">The mash.</param>
        /// <param name="name">The name.</param>
        /// <param name="version">The version.</param>
        public Recipe(
            RecipeType type,
            Style style,
            string brewer,
            double batchSize,
            double boilSize,
            double boilTime,
            Hops hops,
            Fermentables fermentables,
            Miscs miscs,
            Yeasts yeasts,
            Waters waters,
            Mash mash,
            string name,
            int version = Constants.DEFAULT_BEER_XML_VERSION) : base(name, version)
        {
            Validation.ValidateGreaterThanZero(batchSize);
            Validation.ValidateGreaterThanZero(boilSize);
            Validation.ValidateGreaterThanZero(boilTime);
            Validation.ValidateNotNull(style);
            Validation.ValidateNotNull(hops);
            Validation.ValidateNotNull(fermentables);
            Validation.ValidateNotNull(miscs);
            Validation.ValidateNotNull(yeasts);
            Validation.ValidateNotNull(waters);
            Validation.ValidateNotNull(mash);

            this.Type         = type;
            this.Style        = style;
            this.Brewer       = brewer;
            this.Batch_Size   = batchSize;
            this.Boil_Size    = boilSize;
            this.Boil_Time    = boilTime;
            this.Hops         = hops;
            this.Fermentables = fermentables;
            this.Miscs        = miscs;
            this.Yeasts       = yeasts;
            this.Waters       = waters;
            this.Mash         = mash;
        }
예제 #8
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     output = string.Format("{0} 对 {1} 设置 Animator Trigger {2}", Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.TriggerID);
     return(true);
 }
예제 #9
0
파일: SetAIParam.cs 프로젝트: slb1988/agame
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     object[] args = new object[] { Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.Param, this.Value, this.LogicType };
     output = string.Format("{0} 对 {1} 设置 AI 参数 {2}:{3}:{4}", args);
     return(true);
 }
예제 #10
0
파일: ClearCombo.cs 프로젝트: slb1988/agame
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     output = string.Format("{0} 对 {1} 触发技能:清除combo", Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target));
     return(true);
 }
예제 #11
0
        public void Miscs_Valid_Empty()
        {
            Miscs miscs = new Miscs();

            Assert.IsTrue(miscs.IsValid());
        }
예제 #12
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     object[] args = new object[] { Miscs.GetDebugActorName(instancedAbility.caster), this.LevelBuff, instancedAbility.Evaluate(this.Duration), this.AttachModifiers.Length };
     output = string.Format("{0} 触发LevelBuff {1}, 持续时间 {2}, 附带挂 Modifier 数量 {3}", args);
     return(true);
 }
예제 #13
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     output = string.Format("{0} 停止 LevelBuff {1}, 停止对面 side: {2}", Miscs.GetDebugActorName(instancedAbility.caster), this.LevelBuff, this.stopOtherSide);
     return(true);
 }
예제 #14
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     output = string.Format("{0} 对 {1} 开始通过技能造成攻击 AttackProperty {2}", Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.AttackProperty.GetDebugOutput());
     return(true);
 }
예제 #15
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     object[] args = new object[] { Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.Property, instancedAbility.Evaluate(this.Delta) };
     output = string.Format("{0} 对 {1} 更改属性 {2}:{3}", args);
     return(true);
 }
예제 #16
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     object[] args = new object[] { Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.AbilityName, this.AbilityID };
     output = string.Format("{0} 对 {1} 触发技能 {2} {3}", args);
     return(true);
 }
예제 #17
0
 public override bool GetDebugOutput(ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref string output)
 {
     object[] args = new object[] { Miscs.GetDebugActorName(instancedAbility.caster), Miscs.GetDebugActorName(target), this.AnimEventID, Miscs.GetAnimIDAttackPropertyOutput(instancedAbility.caster, this.AnimEventID) };
     output = string.Format("{0} 对 {1} 开始通过技能造成攻击 AnimEventID {2} {3}", args);
     return(true);
 }