public override void Handle(ColorCommand obj) { if (CombinatorValue == null) { CombinatorValue = new _16BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue)); } else { ushort value1 = CombinatorValue.CommandValue; ushort value2 = ColorValue.GetGrayscaleLevel(obj.CommandValue); CombinatorValue = new _16BitCommand(Math.Max(value1, value2)); } }
// Handling intents as an evaluator. public override void Handle(IIntentState <ColorValue> obj) { byte byteLevel = ColorValue.GetGrayscaleLevel(obj.GetValue().Color); EvaluatorValue = new _8BitCommand(byteLevel); }
public void Handle(ColorCommand obj) { EvaluatorValue = new _8BitCommand(ColorValue.GetGrayscaleLevel(obj.CommandValue)); }