Ejemplo n.º 1
0
		void Skill::pass(int val)
		{
			model::SaveData& lsd = getOwner().getProject().getLSD();

			clearCursor();
			addCursor( lsd.memberNum() );
			cursor(0) = val;

			curCharID_ = lsd.member(val);
			idList_ = lsd[108].getArray2D()[curCharID_][52].getBinary();
			idList_.push_back(INVALID_ID);
			addCursor( idList_.size() + 1 );
		}
Ejemplo n.º 2
0
/*Method to execute sql statements like SELECT and return Cursor
Inputs:
query- string containing sql query
qlength - length of query (for binary data). if 0 then assume null terminated.
Output: NULL cursor on error
*/
DBCursor *DBConnection_ORACLE::sqlQuery(char *p_query, DBString *p_arguments, int p_argument_count, int p_rows)
{
	if (!isConnected)
		return NULL;

	Cda_Def *t_cursor;
	t_cursor = ExecuteQuery(p_query, p_arguments, p_argument_count);
	if (t_cursor == NULL)
		return NULL;

	DBCursor_ORACLE *t_rev_cursor;
	t_rev_cursor = new DBCursor_ORACLE();
	if (!t_rev_cursor -> open((DBConnection *)this, t_cursor, p_rows))
	{
		// OK-2007-09-10 : Bug 5360
		delete t_rev_cursor;
		t_rev_cursor = NULL;
		char t_error_message[512];
		oerhms((cda_def *)getLDA(), lda.rc, (text *)t_error_message, (sword) sizeof(t_error_message));
		errorMessageSet(t_error_message);
	}
	else
	{
		// OK-2007-09-10 : Bug 5360
		errorMessageSet(NULL);
		addCursor(t_rev_cursor);
	}

	lda . rc = t_cursor -> rc;

	return (DBCursor *)t_rev_cursor;
}
Ejemplo n.º 3
0
/*Method to execute sql statements like SELECT and return Cursor
Inputs:
query- string containing sql query
qlength - length of query (for binary data). if 0 then assume null terminated.
Output: NULL cursor on error
*/
DBCursor *DBConnection_MYSQL::sqlQuery(char *p_query, DBString *p_arguments, int p_argument_count, int p_rows)
{
	DBCursor_MYSQL *t_cursor;
	t_cursor = NULL;

	if (ExecuteQuery(p_query, p_arguments, p_argument_count))
	{
		t_cursor = new DBCursor_MYSQL();
		if (!t_cursor -> open((DBConnection *)this))
		{
			delete t_cursor;
			t_cursor = NULL;
		}
		else
			addCursor(t_cursor); 
	}

	// OK-2007-09-10 : Bug 5360
	if (t_cursor != NULL)
		errorMessageSet(NULL);
	else
		errorMessageSet(mysql_error(getMySQL()));

	return (DBCursor *)t_cursor;
}
Ejemplo n.º 4
0
		void Menu::gameModeChanged()
		{
			if( (cursorNum() != 1) || (cursor() != 4) ) {
				clearCursor();
				addCursor( command_.size() );
			}
		}
Ejemplo n.º 5
0
		void Item::run(input::KeyListener& keyList)
		{
			if( cursorCountLeft() ) return;

			switch( cursorNum() ) { // item
				case 1: // select item
					if( keyList.enter() ) addCursor( getOwner().getProject().getLSD().item().size() + 1 );
					switch( keyList.getCursor() ) {
						case Key::UP   : decCursor(); cursor()--; break;
						case Key::RIGHT: incCursor(); break;
						case Key::LEFT : decCursor(); break;
						case Key::DOWN : incCursor(); cursor()++; break;
						default: break;
					}
					break;
				case 2: // select char
					if( keyList.cancel() ) {
						cursorMax(0) = getOwner().getProject().getLSD().item().size() + 1;
						if( cursor(0) >= cursorMax(0) ) cursor(0) = cursorMax(0) - 1;
					}
					break;
			}

			if( keyList.cancel() ) {
				if( cursorNum() <= 1 ) getOwner().returnGameMode();
				else removeLastCursor();
			}
		}
Ejemplo n.º 6
0
/*Method to execute sql statements like SELECT and return Cursor
Inputs:
query- string containing sql query
qlength - length of query (for binary data). if 0 then assume null terminated.
Output: NULL cursor on error
*/
DBCursor *DBConnection_SQLITE::sqlQuery(char *query, DBString *args, int numargs, int p_rows)
{
	DBCursor_SQLITE *ret = 0;
	unsigned int qlength;
	char *newquery = (char *)query;

#ifndef NDEBUG
	MDEBUG0("SQLite::sqlQuery\n");
	MDEBUG("Numargs=[%d]\n", numargs);
	MDEBUG("Query=[%s]\n", query);
	
	for(int i = 0; i < numargs; i++) {
		MDEBUG("Args[%d]=[%s]\n", i);
	}
#endif
	
	if (!isConnected)
		return NULL;

	//if null terminated (qlength = 0) then calculate length of query
	qlength = strlen(query);
	//execute query and check for error

	if(numargs) {
		int newsize;
		newquery = BindVariables(query, qlength, args, numargs, newsize);
		qlength = newsize;
	}

	try {
		ret = new DBCursor_SQLITE(mDB);
		Dataset *ds = ret->getDataset();

		ds->query(newquery);
		//try to open cursor..on error delete invalid cursor object and exit with error
		if(!ret->open((DBConnection *)this)) {
			delete ret;
			ret = 0;
			mIsError = true;
			setErrorStr("Unable to open query");
		} else
			addCursor(ret); //add to cursor list

	} catch(DbErrors &e) {
		MDEBUG0("\n\n --- CAUGHT ERROR --- \n");
		mIsError = true;
		setErrorStr(e.getMsg());
		delete ret;
		ret = 0;
	}

	if (numargs)
		delete newquery;

	return ret;
}
int AddCursorDialogImpl::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: addCursor(); break;
        }
        _id -= 1;
    }
    return _id;
}
Ejemplo n.º 8
0
static void init()
{
	int i;
	Entity *e, *prev;

	if (self->mental == 1 || self->mental == -3)
	{
		prev = self;

		for (i=0;i<9;i++)
		{
			e = getFreeEntity();

			if (e == NULL)
			{
				showErrorAndExit("No free slots to add a Jigsaw Puzzle Block");
			}

			loadProperties("item/puzzle_piece", e);

			e->action = &doNothing;

			e->draw = &drawLoopingAnimationToMap;

			e->face = RIGHT;

			e->head = self;

			e->flags |= (FLY|DO_NOT_PERSIST);

			prev->target = e;

			prev = e;
		}

		randomize();
	}

	if (self->mental != -3)
	{
		addCursor();
	}

	self->action = &entityWait;
}
Ejemplo n.º 9
0
/*Method to execute sql statements like SELECT and return Cursor
Inputs:
query- string containing sql query
qlength - length of query (for binary data). if 0 then assume null terminated.
Output: NULL cursor on error
*/
DBCursor *DBConnection_POSTGRESQL::sqlQuery(char *p_query, DBString *p_arguments, int p_argument_count, int p_rows)
{
    PGresult *t_postgres_result;
    t_postgres_result = ExecuteQuery(p_query, p_arguments, p_argument_count);

    ExecStatusType t_status;
    t_status = PQresultStatus(t_postgres_result);

    DBCursor_POSTGRESQL *t_cursor;
    t_cursor = NULL;

    if (t_status == PGRES_TUPLES_OK)
    {
        int t_column_count;
        t_column_count = PQnfields(t_postgres_result);
        if (t_column_count != 0)
        {
            t_cursor = new DBCursor_POSTGRESQL();
            if (!t_cursor -> open((DBConnection *)this, t_postgres_result))
            {
                delete t_cursor;
                t_cursor = NULL;
            }
            else
                addCursor(t_cursor);
        }
        t_postgres_result = NULL;
    }

    // OK-2007-09-10 : Bug 5360, if the query succeeded, we clear the error message, otherwise we set it.
    if (t_cursor != NULL)
        errorMessageSet(NULL);
    else
        errorMessageSet(PQerrorMessage(dbconn));

    return (DBCursor *)t_cursor;
}
Ejemplo n.º 10
0
void FullpipeEngine::initCursors() {
	CursorInfo crs;
	Scene *inv = accessScene(SC_INV);

	addCursor(&crs, inv, PIC_CSR_DEFAULT,     15,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_DEFAULT_INV, 18, 18, 23, 23);
	addCursor(&crs, inv, PIC_CSR_ITN,         11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ITN_RED,     11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ITN_GREEN,   11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ITN_INV,     23, 17, 23, 17);
	addCursor(&crs, inv, PIC_CSR_GOU,         15, 17, 10, 10);
	addCursor(&crs, inv, PIC_CSR_GOD,         15,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_GOL,         26,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_GOR,         15,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_GOFAR_L,      1,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_GOFAR_R,     39,  1, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE1,     12, 24, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE2,     11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE2_D,   22, 15, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE3,     11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE4,     18, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE5,     23, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE6,     11, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE6_D,    0,  0, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE7,     21, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE7_D,    7, 20, 10, 10);
	addCursor(&crs, inv, PIC_CSR_ARCADE8,     23, 11, 10, 10);
	addCursor(&crs, inv, PIC_CSR_LIFT,         6, 13, 10, 10);

	getGameLoaderInputController()->setCursorMode(0);
}
Ejemplo n.º 11
0
static void init()
{
	int i, x, y, col;
	Entity *e, *prev;

	prev = self;

	x = self->x;
	y = self->y + self->h;

	col = 1;

	if (self->mental != 2)
	{
		for (i=0;i<50;i++)
		{
			/* 4 pegs per row, plus 1 score tile and 10 rows */

			e = getFreeEntity();

			if (e == NULL)
			{
				showErrorAndExit("No free slots to add a Mastermind Peg");
			}

			if (col == 5)
			{
				loadProperties("item/mastermind_score", e);

				col = 0;

				e->mental = 1;
			}

			else
			{
				loadProperties("item/mastermind_peg", e);

				e->mental = 0;
			}

			setEntityAnimation(e, "STAND");

			if (i == 0)
			{
				y -= TILE_SIZE;
			}

			if (i != 0 && i % 5 == 0)
			{
				x = self->x;
				y -= TILE_SIZE;
			}

			else if (i != 0)
			{
				x += TILE_SIZE;
			}

			e->face = RIGHT;

			e->x = x;
			e->y = y;

			e->action = &pegWait;

			e->draw = &drawLoopingAnimationToMap;

			prev->target = e;

			prev = e;

			e->target = NULL;

			col++;
		}

		generateSolution();

		addCursor();
	}

	self->action = &entityWait;
}
Ejemplo n.º 12
0
		void Menu::run(input::KeyListener& keyList)
		{
			if( cursorCountLeft() ) return;

			model::Project& proj = getOwner().getProject();
			model::SaveData& lsd = proj.getLSD();

			if( cursorNum() == 1 ) PP_upDown()
			switch( cursor(0) ) {
				case 0: switch( cursorNum() ) { // item
					case 1: // to item select
						if( keyList.enter() ) getOwner().callGameMode( GameMode::Item );
						break;
				} break;
				case 1: switch( cursorNum() ) { // skill
					case 1: // to source char select
						if( keyList.enter() ) addCursor( lsd.memberNum() );
						break;
					case 2: // select source char
						if( keyList.enter() ) {
							getOwner().passToGameMode( GameMode::Skill, cursor() );
							removeLastCursor();
							getOwner().callGameMode( GameMode::Skill );
							return;
						}
						PP_upDown()
						break;
				} break;
				case 2: switch( cursorNum() ) { // equip
					case 1: // to char select
						if( keyList.enter() ) addCursor( lsd.memberNum() );
						break;
					case 2: // select char
						if( keyList.enter() ) {
							getOwner().passToGameMode( GameMode::Equip, cursor() );
							removeLastCursor();
							getOwner().callGameMode( GameMode::Equip );
							return;
						}
						PP_upDown()
						break;
				} break;
				case 3: switch( cursorNum() ) { // save
					case 1:
						if( keyList.enter() && proj.canSave() ) {
							getOwner().passToGameMode( GameMode::SaveManager, SaveManager::SAVE );
							getOwner().callGameMode(GameMode::SaveManager);
							return;
						}
						break;
				} break;
				case 4: switch( cursorNum() ) { // quit
					case 1:
						if( keyList.enter() ) addCursor(2);
						break;
					case 2:
						if( keyList.enter() ) getOwner().gotoTitle();
						else PP_upDown()
						break;
				} break;
			}

			if( keyList.cancel() ) {
				if( cursorNum() <= 1 ) getOwner().returnGameMode();
				else removeLastCursor();
			}
		}
Ejemplo n.º 13
0
		void Item::gameModeChanged()
		{
			clearCursor();
			addCursor( getOwner().getProject().getLSD().item().size() + 1 );
		}