if(equal-bool)

koadrobot/logics/if(equal-bool)

No description
if(equal-bool)
@/if(equal-bool)
Lnumber
Rnumber
Tboolean
Value to be output if condition is true
Fboolean
Value to be output if condition is false.
if(equal-bool)
OUT
L
R
T
F
OUTboolean
To use the node in your project you should have the koadrobot/logics library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto in1 = getValue<input_L>(ctx);
    auto in2 = getValue<input_R>(ctx);
    bool trueVal = getValue<input_T>(ctx);
    bool falseVal = getValue<input_F>(ctx);
    emitValue<output_OUT>(ctx, (in1==in2) ? trueVal : falseVal);
}

Tabular tests

LRTFOUT
105truefalsefalse
1010falsetruetrue
510truefalsetrue
55falsetruefalse