private void Editor_ConditionChanged(SelectorConditionEditor sender, NodeSetting.SelectorCondition value) { foreach (NodeUi nodeUi in selectedNodes) { nodeUi.Node.SetSetting(sender.Setting.type, value); } }
private bool Evaluate(NodeSetting.SelectorCondition condition, int value) { switch (condition.operation) { case NodeSetting.SelectorCondition.LogicOperation.Equal: return value == condition.rhsArgument; case NodeSetting.SelectorCondition.LogicOperation.NotEqual: return value != condition.rhsArgument; case NodeSetting.SelectorCondition.LogicOperation.LessThan: return value < condition.rhsArgument; case NodeSetting.SelectorCondition.LogicOperation.LessThanOrEqual: return value <= condition.rhsArgument; case NodeSetting.SelectorCondition.LogicOperation.GreaterThan: return value > condition.rhsArgument; case NodeSetting.SelectorCondition.LogicOperation.GreaterThanOrEqual: return value >= condition.rhsArgument; } return false; }