當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Condition類代碼示例

本文整理匯總了C#中System.Condition的典型用法代碼示例。如果您正苦於以下問題:C# Condition類的具體用法?C# Condition怎麽用?C# Condition使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Condition類屬於System命名空間,在下文中一共展示了Condition類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Equals

 public override bool Equals(Condition other)
 {
     AndCondition ot = other as AndCondition;
     if(ot == null)
         return false;
     return IteratorEquals(_conditions.GetEnumerator(), ot._conditions.GetEnumerator());
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:7,代碼來源:AndCondition.cs

示例2: Weapon

 /// <summary>
 /// Create a new weapon
 /// </summary>
 /// <param name="name">name of the weapon</param>
 /// <param name="type">class of weapon</param>
 /// <param name="hulls">class fo ship that can mount this weapon</param>
 /// <param name="slots">locatiosn where this weapon can be mounted</param>
 /// <param name="power">power used by this weapon</param>
 /// <param name="space">space used by this method</param>
 /// <param name="sp">cost of this weapon</param>
 /// <param name="str">strength of the weapon</param>
 /// <param name="damage">damage of the weapon</param>
 /// <param name="crit">crit rating of the weapon</param>
 /// <param name="range">range of the weapon</param>
 /// <param name="origin">rulebook containing this weapon</param>
 /// <param name="page">page this weapon can be found on</param>
 /// <param name="quality">quality of this weapon</param>
 /// <param name="wq">enum declaring which qualities to be adjusted</param>
 /// <param name="special">special rules of this weapon</param>
 /// <param name="turbo">Quality of turboweapon battery upgrade if applicable</param>
 public Weapon(string name, WeaponType type, HullType hulls, WeaponSlot slots, int power, int space, 
     int sp, int str, string damage, int crit, int range, RuleBook origin, byte page, Quality quality = Quality.Common,
     WeaponQuality wq = WeaponQuality.None, string special = null, Quality turbo = Quality.None, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : this(name, type, hulls, slots, power, space, sp, str, new DiceRoll(damage), crit, range, 
     origin, page, quality, wq, special, turbo, comp, cond)
 {
 }
開發者ID:hooperk,項目名稱:Starship,代碼行數:27,代碼來源:Weapon.cs

示例3: LandingBay

 /// <summary>
 /// Create a new Landing Bay
 /// </summary>
 /// <param name="name">name of the landing bay</param>
 /// <param name="hulls">class fo ship that can mount this weapon</param>
 /// <param name="slots">locatiosn where this weapon can be mounted</param>
 /// <param name="power">power used by this weapon</param>
 /// <param name="space">space used by this method</param>
 /// <param name="sp">cost of this weapon</param>
 /// <param name="str">strength of the weapon</param>
 /// <param name="capacity">total ammo capacity of the torpedo tube</param>
 /// <param name="origin">rulebook containing this weapon</param>
 /// <param name="page">page this weapon can be found on</param>
 /// <param name="quality">quality of this weapon</param>
 /// <param name="wq">enum declaring which qualities to be adjusted</param>
 /// <param name="special">special rules of this weapon</param>
 public LandingBay(string name, HullType hulls, WeaponSlot slots, int power, int space, int sp, int str,
     RuleBook origin, byte page, Quality quality = Quality.Common, WeaponQuality wq = WeaponQuality.None,
     string special = null, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : base(name, WeaponType.LandingBay, hulls, slots, power, space, sp, str, default(DiceRoll), 0, 0, origin, page, quality, wq, special, Quality.None, comp, cond)
 {
     Squadrons = new List<Squadron>(Strength * 3);
 }
開發者ID:hooperk,項目名稱:Starship,代碼行數:23,代碼來源:LandingBay.cs

示例4: TestClone

        public void TestClone()
        {
            IConditionGroup group = new ConditionGroup(Guid.NewGuid(), new TranslateableLanguageItem(Guid.NewGuid()), ConditionLogic.AND, true);
            ICondition condition1 = new Condition(Guid.NewGuid(), "className1", new TranslateableLanguageItem(Guid.NewGuid()), OperatorType.GreaterThan);
            ICondition condition2 = new Condition(Guid.NewGuid(), "className2", new TranslateableLanguageItem(Guid.NewGuid()), OperatorType.LessThan);
            group.Conditions.Add(condition1);
            group.Conditions.Add(condition2);

            IConditionGroup copyGroup = (group as PolicyObject).Clone() as IConditionGroup;
            Assert.IsNotNull(copyGroup);
            Assert.AreNotEqual(group.Identifier, copyGroup.Identifier);
            Assert.AreEqual(group.Logic, copyGroup.Logic);
            Assert.AreNotEqual(group.Name.Identifier, copyGroup.Name.Identifier);
            Assert.AreEqual(group.Name.Value, copyGroup.Name.Value);
            Assert.AreEqual(group.ReadOnly, copyGroup.ReadOnly);
            Assert.IsNotNull(copyGroup.Conditions);
            Assert.AreEqual(group.Conditions.Count, copyGroup.Conditions.Count);

            ICondition copyCondition1 = copyGroup.Conditions[0] as ICondition;
            Assert.IsNotNull(copyCondition1);
            Assert.AreNotEqual(condition1.Identifier, copyCondition1.Identifier);
            Assert.AreNotEqual(condition1.Name.Identifier, copyCondition1.Name.Identifier);
            Assert.AreEqual(condition1.Name.Value, copyCondition1.Name.Value);
            Assert.AreEqual(condition1.Operator, copyCondition1.Operator);
            Assert.AreEqual(condition1.ReadOnly, copyCondition1.ReadOnly);

            ICondition copyCondition2 = copyGroup.Conditions[1] as ICondition;
            Assert.IsNotNull(copyCondition2);
            Assert.AreNotEqual(condition2.Identifier, copyCondition2.Identifier);
            Assert.AreNotEqual(condition2.Name.Identifier, copyCondition2.Name.Identifier);
            Assert.AreEqual(condition2.Name.Value, copyCondition2.Name.Value);
            Assert.AreEqual(condition2.Operator, copyCondition2.Operator);
            Assert.AreEqual(condition2.ReadOnly, copyCondition2.ReadOnly);
        }
開發者ID:killbug2004,項目名稱:WSProf,代碼行數:34,代碼來源:TestConditionGroup.cs

示例5: Equals

 public override bool Equals(Condition other)
 {
     EntityCondition ot = other as EntityCondition;
     if(ot == null)
         return false;
     return _entityId.Equals(ot._entityId);
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:7,代碼來源:EntityCondition.cs

示例6: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            string input;

            if (!inputbox.Visible)
            {
                Point formLoc = this.Location;
                Point butnLoc = button1.Location;
                inputbox.Show();
                inputbox.Location = new Point(formLoc.X + butnLoc.X,
                    formLoc.Y + butnLoc.Y);
                inputbox.Location = new Point(inputbox.Location.X + 55,
                    inputbox.Location.Y);
            }
            else
            {
                inputbox.Hide();
                input = inputbox.input;
                inputbox.input = "";
                inputbox.textBox1.Text = "";

                Condition cond = new Condition();
                if (input.Length > 0)
                {
                    cond.Description = input;
                    parentGame.Editor.activeFlag.Conditions.Add(cond);
                    input = "";
                }
            }
        }
開發者ID:alittle1234,項目名稱:XNA_Project,代碼行數:30,代碼來源:Form2.cs

示例7: RaiseArmTrigger

        public RaiseArmTrigger(XmlNode node)
        {
            mHeightThreshold = Nui.magnitude(Nui.joint(Nui.Shoulder_Centre) - Nui.joint(Nui.Hip_Centre));
            mAngleThreshold = Scalar.Create(.48f);
            mDepthThreshold = Scalar.Create(GetFloat(node, 3.6f, "DepthThreshold"));
            mWidthThreshold = Scalar.Create(GetFloat(node, 1f, "WidthThreshold"));

            mBody = Nui.joint(Nui.Hip_Centre);

            Condition inWidth = Nui.abs(Nui.x(Nui.joint(Nui.Hip_Centre))) < mWidthThreshold;
            Condition inDepth = Nui.z(Nui.joint(Nui.Hip_Centre)) < mDepthThreshold;
            Condition inRange = C.And(inWidth, inDepth);

            Vector up = Vector.Create(0f, 1f, 0f);
            mArmR = Nui.joint(Nui.Hand_Right) - Nui.joint(Nui.Shoulder_Right);
            mArmL = Nui.joint(Nui.Hand_Left) - Nui.joint(Nui.Shoulder_Left);
            mAngleR = Nui.dot(up, mArmR);
            mAngleL = Nui.dot(up, mArmL);

            mTriggerR = C.And(Nui.y(mArmR) > mHeightThreshold, mAngleR > mAngleThreshold);
            mTriggerL = C.And(Nui.y(mArmL) > mHeightThreshold, mAngleL > mAngleThreshold);
            mTrigger = C.And(C.Or(mTriggerR, mTriggerL), inRange);

            mTrigger.OnChange += new ChangeDelegate(mTrigger_OnChange);
        }
開發者ID:JohnMcCaffery,項目名稱:ChimeraClean,代碼行數:25,代碼來源:RaiseArmTrigger.cs

示例8: Parse

        internal static TestExpressionInfo Parse(string critiera, Condition condition, string value)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(critiera));
            Contract.Requires(value != null);

            var g = EnumParsing.TryParse<InputCriteria>(critiera);
            var e = EnumParsing.TryParse<EventCriteria>(critiera);

            object val = null;
            if (e.HasValue)
            {
                val = UInt32.Parse(value);
            }
            if (g.HasValue)
            {
                switch (g.Value)
                {
                    case InputCriteria.Mode:
                        val = EnumParsing.Parse<Mode>(value);
                        break;
                    case InputCriteria.Variant:
                        val = EnumParsing.Parse<Variant>(value);
                        break;
                    default: throw new ArgumentOutOfRangeException();
                }
            }

            Contract.Assert(val != null);

            return new TestExpressionInfo(e.HasValue ? e.Value : EventCriteria.None,
                                            g.HasValue ? g.Value : InputCriteria.None,
                                            condition,
                                            val);
        }
開發者ID:robrodi,項目名稱:DslSample,代碼行數:34,代碼來源:TestExpressionInfo.cs

示例9: ConditionDescription

 private ConditionDescription()
 {
     conditions = new Condition[3];
     conditions[0] = new CombinedCondition(subType, values);
     conditions[1] = new CombinedCondition(subType, damageTypes);
     conditions[2] = new CombinedCondition(subType, charTypes);
 }
開發者ID:Desocrit,項目名稱:BoDCode,代碼行數:7,代碼來源:EffectCondition.cs

示例10: Equals

 public override bool Equals(Condition other)
 {
     ArchitectureCondition ot = other as ArchitectureCondition;
     if(ot == null)
         return false;
     return _match.Equals(ot._match);
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:7,代碼來源:ArchitectureCondition.cs

示例11: CouldMergeToCoalescedTreeNode

 protected override bool CouldMergeToCoalescedTreeNode(Condition condition)
 {
     foreach(Condition c in _conditions)
         if(c.Equals(condition))
             return true;
     return false;
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:7,代碼來源:AndCondition.cs

示例12: Equals

 public override bool Equals(Condition other)
 {
     NotCondition ot = other as NotCondition;
     if(ot == null)
         return false;
     return _condition.Equals(ot._condition);
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:7,代碼來源:NotCondition.cs

示例13: CrewSustainer

 /// <summary>
 /// Create a new Crew Quarters or Life Sustainer
 /// </summary>
 /// <param name="name">name of teh life sustainer of crew quarters</param>
 /// <param name="types">classes of ship which can use this component</param>
 /// <param name="power">power used by this component</param>
 /// <param name="space">space used by this component</param>
 /// <param name="morale">morale modifier of this component</param>
 /// <param name="origin">rulebook containing this component</param>
 /// <param name="page">page this component can be found on</param>
 /// <param name="special">special rules for this component</param>
 /// <param name="quality">quality of this component</param>
 /// <param name="sp">cost of this component</param>
 /// <param name="loss">modifier to morale loss granted by this component</param>
 public CrewSustainer(string name, HullType types, int power, int space, int morale, RuleBook origin, byte page,
     string special = null, Quality quality = Quality.Common, int sp = 0, int loss = 0, ComponentOrigin comp = ComponentOrigin.Standard, Condition cond = Condition.Intact)
     : base(name, sp, power, space, special, origin, page, types, quality, comp, cond)
 {
     this.Morale = morale;
     this.MoraleLoss = loss;
 }
開發者ID:hooperk,項目名稱:Starship,代碼行數:21,代碼來源:CrewSustainer.cs

示例14: Rule

 public Rule(Condition condition, string val, Action action)
     : this()
 {
     Condition   = condition;
     Val         = val;
     Action      = action;
 }
開發者ID:lsalamon,項目名稱:solution2010,代碼行數:7,代碼來源:Rule.cs

示例15: GetDeleteStatement

 public override SqlStatement GetDeleteStatement(Condition iwc)
 {
     var sb = new UpdateStatementBuilder(Context.Info.From);
     sb.Values.Add(new KeyOpValue(_columnName, true, KvOpertation.None));
     sb.Where.Conditions = iwc && _colExp;
     return sb.ToSqlStatement(Context);
 }
開發者ID:991899783,項目名稱:DbEntry,代碼行數:7,代碼來源:SoftDeleteQueryComposer.cs


注:本文中的System.Condition類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。