コード例 #1
0
 /// <summary>
 /// Applies the specified variables to the specified feature bundle.
 /// </summary>
 /// <param name="fb">The feature bundle.</param>
 /// <param name="variables">The variables.</param>
 /// <param name="instantiatedVars">The instantiated variables.</param>
 /// <param name="val">if <c>true</c> the feature bundle values will be set, otherwise they will be unset.</param>
 public void Apply(FeatureBundle fb, IDictionary <string, bool> variables, VariableValues instantiatedVars, bool val)
 {
     foreach (KeyValuePair <string, bool> varPolarity in variables)
     {
         foreach (FeatureValue value in GetVarFeatValue(varPolarity.Key, varPolarity.Value, instantiatedVars))
         {
             fb.Set(value, val);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Applies the specified variables that occur in the instantiated variables to the specified feature bundle.
 /// </summary>
 /// <param name="fb">The feature bundle.</param>
 /// <param name="variables">The variables.</param>
 /// <param name="instantiatedVars">The instantiated variables.</param>
 public void ApplyCurrent(FeatureBundle fb, IDictionary <string, bool> variables, VariableValues instantiatedVars)
 {
     foreach (KeyValuePair <string, bool> varPolarity in variables)
     {
         Feature feature = m_varFeatures[varPolarity.Key];
         ICollection <FeatureValue> varValues = instantiatedVars.GetValues(varPolarity.Key);
         if (varValues.Count > 0)
         {
             foreach (FeatureValue value in GetCurVarFeatValue(feature, varValues, varPolarity.Value))
             {
                 fb.Set(value, true);
             }
         }
     }
 }
コード例 #3
0
ファイル: AlphaVariables.cs プロジェクト: bbriggs/FieldWorks
		/// <summary>
		/// Applies the specified variables to the specified feature bundle.
		/// </summary>
		/// <param name="fb">The feature bundle.</param>
		/// <param name="variables">The variables.</param>
		/// <param name="instantiatedVars">The instantiated variables.</param>
		/// <param name="val">if <c>true</c> the feature bundle values will be set, otherwise they will be unset.</param>
		public void Apply(FeatureBundle fb, IDictionary<string, bool> variables, VariableValues instantiatedVars, bool val)
		{
			foreach (KeyValuePair<string, bool> varPolarity in variables)
			{
				foreach (FeatureValue value in GetVarFeatValue(varPolarity.Key, varPolarity.Value, instantiatedVars))
					fb.Set(value, val);
			}
		}
コード例 #4
0
ファイル: AlphaVariables.cs プロジェクト: bbriggs/FieldWorks
		/// <summary>
		/// Applies the specified variables that occur in the instantiated variables to the specified feature bundle.
		/// </summary>
		/// <param name="fb">The feature bundle.</param>
		/// <param name="variables">The variables.</param>
		/// <param name="instantiatedVars">The instantiated variables.</param>
		public void ApplyCurrent(FeatureBundle fb, IDictionary<string, bool> variables, VariableValues instantiatedVars)
		{
			foreach (KeyValuePair<string, bool> varPolarity in variables)
			{
				Feature feature = m_varFeatures[varPolarity.Key];
				ICollection<FeatureValue> varValues = instantiatedVars.GetValues(varPolarity.Key);
				if (varValues.Count > 0)
				{
					foreach (FeatureValue value in GetCurVarFeatValue(feature, varValues, varPolarity.Value))
						fb.Set(value, true);
				}
			}
		}