forked from jaildesigner-jailgames/jaildoctors_dilemma
Trabajando en las estadisticas online
This commit is contained in:
@@ -41,7 +41,6 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
music = JA_LoadMusic(asset->get("game.ogg").c_str());
|
||||
deathSound = JA_LoadSound(asset->get("death.wav").c_str());
|
||||
stats = new Stats(asset->get("stats.csv"), options);
|
||||
stats->addVisit(room->getName());
|
||||
|
||||
// Inicializa el resto de variables
|
||||
ticks = 0;
|
||||
@@ -57,6 +56,8 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
blackScreen = false;
|
||||
blackScreenCounter = 0;
|
||||
totalItems = getTotalItems();
|
||||
initStats();
|
||||
stats->addVisit(room->getName());
|
||||
|
||||
section.name = SECTION_PROG_GAME;
|
||||
section.subsection = 0;
|
||||
@@ -619,4 +620,16 @@ void Game::checkRestoringJail()
|
||||
board.lives++;
|
||||
JA_PlaySound(deathSound);
|
||||
}
|
||||
}
|
||||
|
||||
// Inicializa el diccionario de las estadísticas
|
||||
void Game::initStats()
|
||||
{
|
||||
std::vector<res_room_t> *rooms = new std::vector<res_room_t>;
|
||||
rooms = resource->getAllRooms();
|
||||
|
||||
for (auto room : *rooms)
|
||||
{
|
||||
stats->addDictionary(room.room->number, room.room->name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user