exports.u_redCallback = function (result, chars, phraseIndex) {
result.state = id.NOMATCH;
result.phraseLength = 0;
if (phraseIndex + 3 <= chars.length) {
if (chars[phraseIndex] === 114 && chars[phraseIndex + 1] === 101 && chars[phraseIndex + 2] === 100) {
result.state = id.MATCH;
result.phraseLength = 3;
}
}
};
exports.u_whiteCallback = function (result, chars, phraseIndex) {
result.state = id.NOMATCH;
result.phraseLength = 0;
if (phraseIndex + 5 <= chars.length) {
if (
chars[phraseIndex] === 119 &&
chars[phraseIndex + 1] === 104 &&
chars[phraseIndex + 2] === 105 &&
chars[phraseIndex + 3] === 116 &&
chars[phraseIndex + 4] === 101
) {
result.state = id.MATCH;
result.phraseLength = 5;
}
}
};
exports.u_blueCallback = function (result, chars, phraseIndex) {
result.state = id.NOMATCH;
result.phraseLength = 0;
if (phraseIndex + 4 <= chars.length) {
if (
chars[phraseIndex] === 98 &&
chars[phraseIndex + 1] === 108 &&
chars[phraseIndex + 2] === 117 &&
chars[phraseIndex + 3] === 101
) {
result.state = id.MATCH;
result.phraseLength = 4;
}
}
};
exports.u_yellowCallback = function (result, chars, phraseIndex) {
result.state = id.NOMATCH;
result.phraseLength = 0;
if (phraseIndex + 6 <= chars.length) {
if (
chars[phraseIndex] === 121 &&
chars[phraseIndex + 1] === 101 &&
chars[phraseIndex + 2] === 108 &&
chars[phraseIndex + 3] === 108 &&
chars[phraseIndex + 4] === 111 &&
chars[phraseIndex + 5] === 119
) {
result.state = id.MATCH;
result.phraseLength = 6;
}
}
};