本文整理汇总了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());
}
示例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)
{
}
示例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);
}
示例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);
}
示例5: Equals
public override bool Equals(Condition other)
{
EntityCondition ot = other as EntityCondition;
if(ot == null)
return false;
return _entityId.Equals(ot._entityId);
}
示例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 = "";
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例10: Equals
public override bool Equals(Condition other)
{
ArchitectureCondition ot = other as ArchitectureCondition;
if(ot == null)
return false;
return _match.Equals(ot._match);
}
示例11: CouldMergeToCoalescedTreeNode
protected override bool CouldMergeToCoalescedTreeNode(Condition condition)
{
foreach(Condition c in _conditions)
if(c.Equals(condition))
return true;
return false;
}
示例12: Equals
public override bool Equals(Condition other)
{
NotCondition ot = other as NotCondition;
if(ot == null)
return false;
return _condition.Equals(ot._condition);
}
示例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;
}
示例14: Rule
public Rule(Condition condition, string val, Action action)
: this()
{
Condition = condition;
Val = val;
Action = action;
}
示例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);
}