bool CSymbolEngineChecksBetsFolds::EvaluateSymbol(const CString name, double *result, bool log /* = false */) { FAST_EXIT_ON_OPENPPL_SYMBOLS(name); if (memcmp(name, "nopponents", 10)==0) { if (memcmp(name, "nopponentschecking", 18)==0 && strlen(name)==18) { *result = nopponentschecking(); } else if (memcmp(name, "nopponentsbetting", 17)==0 && strlen(name)==17) { *result = nopponentsbetting(); } else if (memcmp(name, "nopponentsfolded", 16)==0 && strlen(name)==16) { *result = nopponentsfolded(); } else { // Invalid symbol return false; } // Valid symbol return true; } if (memcmp(name, "nplayerscallshort", 17)==0 && strlen(name)==17) { *result = nplayerscallshort(); } else if (memcmp(name, "foldbits", 8)==0 && strlen(name)==9) { *result = foldbits(name[8]-'0'); } else { // Symbol of a different symbol-engine return false; } // Valid symbol return true; }
bool CSymbolEngineRaisersCallers::EvaluateSymbol(const char *name, double *result, bool log /* = false */) { FAST_EXIT_ON_OPENPPL_SYMBOLS(name); if (memcmp(name, "nopponents", 10)==0) { if (memcmp(name, "nopponentschecking", 18)==0 && strlen(name)==18) { *result = nopponentschecking(); } else if (memcmp(name, "nopponentscalling", 17)==0 && strlen(name)==17) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = nopponentscalling(); } else if (memcmp(name, "nopponentstruelyraising", 23)==0 && strlen(name)==23) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = nopponentstruelyraising(); } else if (memcmp(name, "nopponentsbetting", 17)==0 && strlen(name)==17) { *result = nopponentsbetting(); } else if (memcmp(name, "nopponentsfolded", 16)==0 && strlen(name)==16) { *result = nopponentsfolded(); } else { // Invalid symbol return false; } // Valid symbol return true; } if (memcmp(name, "nplayerscallshort", 17)==0 && strlen(name)==17) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = nplayerscallshort(); } else if (memcmp(name, "raischair", 9)==0 && strlen(name)==9) { *result = raischair(); } else if (memcmp(name, "raisbits", 8)==0 && strlen(name)==9) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = raisbits(name[8]-'0'); } else if (memcmp(name, "callbits", 8)==0 && strlen(name)==9) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = callbits(name[8]-'0'); } else if (memcmp(name, "foldbits", 8)==0 && strlen(name)==9) { RETURN_UNDEFINED_VALUE_IF_NOT_MY_TURN *result = foldbits(name[8]-'0'); } else if (memcmp(name, "lastraised", 10)==0 && strlen(name)==11) { *result = LastRaised(name[10]-'0'); } else { // Symbol of a different symbol-engine return false; } // Valid symbol return true; }