Exemplo n.º 1
0
bool lGLTF::getArray( std::vector<ELEMENTS> &_array ) {
   if ( !expect( '[' ) )
      return false;

   if ( expect( ']', true, true ) )
      return true;

   _array.clear();
   ELEMENTS lTemp;

   while ( vIter != vEnd ) {
      if ( !continueWhitespace() )
         return false;

      if ( *vIter == '"' ) {
         if ( !getMapElement( lTemp ) )
            return false;
      } else {
         if ( !getMapElementETC( lTemp ) )
            return false;
      }

      _array.push_back( lTemp );

      END_GLTF_ARRAY
   }

   return true;
}
Exemplo n.º 2
0
void GameState::printBigFoodsMap()
{
    for (int i = height_ -1 ; i > -1  ; i--) {
        std::ostringstream foo;
        foo << std::fixed;
        foo << std::setprecision(0);
        //foo << std::setw(5) << std::setfill('0');
        for (int j = 1 ; j < width_ - 1 ; j++) {
            if( getMapElement(j, i) == WALL)
                foo << "###" << ' ';
            else
            {
                int chance = big_foods_map_[i][j]*100;

                if (chance >= 90)
                    foo << "\033[48;5;46m";
                else if (chance >= 50)
                    foo << "\033[48;5;30m";
                else if (chance >= 30)
                    foo << "\033[48;5;22m";
                else
                    foo << "\033[48;5;12m";

                foo << std::setw(3) << std::setfill('0') << chance;

                foo << "\033[0m" << ' ';
            }
        }
        ROS_INFO_STREAM(foo.str());
    }
}
Exemplo n.º 3
0
void GameState::printPacmanOrGhostPose( bool is_pacman, int ghost_index)
{
    for (int i = height_ -1 ; i > -1  ; i--) {
        std::ostringstream foo;
        foo << std::fixed;
        foo << std::setprecision(0);
        //foo << std::setw(5) << std::setfill('0');
        for (int j = 1 ; j < width_ - 1 ; j++) {
            if( getMapElement(j, i) == WALL)
                foo << "###" << ' ';
            else
            {
                int chance = -1;

                if (is_pacman)
                    chance = pacman_pose_map_[i][j]*100;
                else
                    chance = ghosts_poses_map_[ghost_index][i][j]*100;

                if (chance >= 90)
                    foo << "\033[48;5;46m";
                else if (chance >= 50)
                    foo << "\033[48;5;30m";
                else if (chance >= 30)
                    foo << "\033[48;5;22m";
                else
                    foo << "\033[48;5;12m";

                foo << std::setw(3) << std::setfill('0') << chance;

                foo << "\033[0m" << ' ';
            }
        }
        ROS_INFO_STREAM(foo.str());
    }
}