コード例 #1
0
ファイル: battlescene.cpp プロジェクト: Airisu/pokemon-online
void BattleScene::useCommands()
{
    if (!playingCommands()) {
        activelyReplaying = true;
        while (!isPaused() && commands.size() > 0) {
            useCommand();
        }
        activelyReplaying = false;
    }
}
コード例 #2
0
// 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);
	}
}