Exemplo n.º 1
0
	void Print() 
	{
		char buf[ MAPX+1 ];

		MPVector< void* > stateVec;
		
		if ( showConsidered )
			pather->StatesInPool( &stateVec );
		printf( " doors %s\n", doorsOpen ? "open" : "closed" );
		printf( " 0         10        20\n" );
		printf( " 012345678901234567890123456789\n" );
		for( int j=0; j<MAPY; ++j ) {
			// Copy in the line.
			memcpy( buf, &gMap[MAPX*j], MAPX+1 );
			buf[MAPX]=0;

			#ifdef USE_PATHER
			unsigned k;
			// Wildly inefficient demo code.
			unsigned size = path.size();
			for( k=0; k<size; ++k ) {
				int x, y;
				NodeToXY( path[k], &x, &y );
				if ( y == j )
					buf[x] = '0' + k%10;
			}
			if ( showConsidered )
			{
    			for( k=0; k<stateVec.size(); ++k ) {
           			int x, y;
    				NodeToXY( stateVec[k], &x, &y );
    				if ( y == j )
    					buf[x] = 'x';
        		}     
      		}  		
			#endif
			
			// Insert the player
			if ( j==playerY )
				buf[playerX] = 'i';

			printf( "%d%s\n", j%10, buf );
		}
	}