Eliminados todos los std:: del código

This commit is contained in:
2023-09-16 12:44:40 +02:00
parent 71be364141
commit 4a2d27dc59
35 changed files with 539 additions and 504 deletions

View File

@@ -35,8 +35,8 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
itemTracker = new ItemTracker();
roomTracker = new RoomTracker();
room = new Room(resource->getRoom(currentRoom), renderer, screen, asset, options, itemTracker, &board.items, false, debug);
const std::string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
const std::string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
const string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
const string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
const player_t player = {spawnPoint, playerPNG, playerANI, renderer, resource, asset, options, input, room, debug};
this->player = new Player(player);
eventHandler = new SDL_Event();
@@ -51,7 +51,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
{
if (options->console)
{
std::cout << "Error: roomNameTexture could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
cout << "Error: roomNameTexture could not be created!\nSDL Error: " << SDL_GetError() << endl;
}
}
@@ -322,9 +322,9 @@ void Game::render()
// Pasa la información de debug
void Game::updateDebugInfo()
{
debug->add("X = " + std::to_string((int)player->x) + ", Y = " + std::to_string((int)player->y));
debug->add("VX = " + std::to_string(player->vx).substr(0, 4) + ", VY = " + std::to_string(player->vy).substr(0, 4));
debug->add("STATE = " + std::to_string(player->state));
debug->add("X = " + to_string((int)player->x) + ", Y = " + to_string((int)player->y));
debug->add("VX = " + to_string(player->vx).substr(0, 4) + ", VY = " + to_string(player->vy).substr(0, 4));
debug->add("STATE = " + to_string(player->state));
}
// Pone la información de debug en pantalla
@@ -365,7 +365,7 @@ void Game::renderRoomName()
}
// Cambia de habitación
bool Game::changeRoom(std::string file)
bool Game::changeRoom(string file)
{
// En las habitaciones los limites tienen la cadena del fichero o un 0 en caso de no limitar con nada
if (file == "0")
@@ -413,7 +413,7 @@ void Game::checkPlayerOnBorder()
{
if (player->getOnBorder())
{
const std::string roomName = room->getRoom(player->getBorder());
const string roomName = room->getRoom(player->getBorder());
if (changeRoom(roomName))
{
player->switchBorders();
@@ -490,8 +490,8 @@ void Game::killPlayer()
// Crea la nueva habitación y el nuevo jugador
room = new Room(resource->getRoom(currentRoom), renderer, screen, asset, options, itemTracker, &board.items, board.jailEnabled, debug);
const std::string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
const std::string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
const string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
const string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
const player_t player = {spawnPoint, playerPNG, playerANI, renderer, resource, asset, options, input, room, debug};
this->player = new Player(player);
@@ -505,7 +505,7 @@ void Game::reLoadTextures()
{
if (options->console)
{
std::cout << "** RELOAD REQUESTED" << std::endl;
cout << "** RELOAD REQUESTED" << endl;
}
player->reLoadTexture();
room->reLoadTexture();
@@ -518,7 +518,7 @@ void Game::switchPalette()
{
if (options->console)
{
std::cout << "** PALETTE SWITCH REQUESTED" << std::endl;
cout << "** PALETTE SWITCH REQUESTED" << endl;
}
// Modifica la variable
@@ -608,7 +608,7 @@ bool Game::checkEndGame()
int Game::getTotalItems()
{
int items = 0;
std::vector<res_room_t> *rooms = new std::vector<res_room_t>;
vector<res_room_t> *rooms = new vector<res_room_t>;
rooms = resource->getAllRooms();
for (auto room : *rooms)
@@ -622,7 +622,7 @@ int Game::getTotalItems()
// Va a la habitación designada
void Game::goToRoom(int border)
{
const std::string roomName = room->getRoom(border);
const string roomName = room->getRoom(border);
if (changeRoom(roomName))
{
currentRoom = roomName;
@@ -682,7 +682,7 @@ void Game::checkRestoringJail()
// Inicializa el diccionario de las estadísticas
void Game::initStats()
{
std::vector<res_room_t> *rooms = new std::vector<res_room_t>;
vector<res_room_t> *rooms = new vector<res_room_t>;
rooms = resource->getAllRooms();
for (auto room : *rooms)