void BattleScene::useCommands() { if (!playingCommands()) { activelyReplaying = true; while (!isPaused() && commands.size() > 0) { useCommand(); } activelyReplaying = false; } }
// Recibe un numero u comando-operador // devuelve codigo de error u OK int operate(const char* item){ if( isConvertibleToDouble(item) == 1 ){ // convierto a doble y lo meto a la pila double* valuePtr = malloc(sizeof(double)); *valuePtr = strtod(item, NULL); P_Poner(stack, valuePtr); return OK; } else { return useCommand(item); } }