Empezando a trabajar con los logros

This commit is contained in:
2022-12-29 09:09:36 +01:00
parent 8959b7bcce
commit a2f1efd2a6
9 changed files with 107 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "common/screen.h"
#include "common/utils.h"
#include <string>
#include <vector>
@@ -7,21 +8,38 @@
#ifndef CHEEVOS_H
#define CHEEVOS_H
struct cheevos_t
{
int id; // Identificador del logro
std::string caption; // Texto que describe el logro
bool completed; // Indica si se ha obtenido el logro
};
class Cheevos
{
private:
// Punteros y objetos
options_t *options;
Screen *screen; // Objeto encargado de dibujar en pantalla
options_t *options; // Puntero a las opciones del juego
// Variables
std::vector<cheevos_t> cheevos; // Listado de logros
// Inicializa los logros
void init();
// Busca un logro por id y devuelve el indice
int findCheevo(int id);
public:
// Constructor
Cheevos(options_t *options);
Cheevos(Screen *screen, options_t *options);
// Destructor
~Cheevos();
// Desbloquea un logro
void unlockCheevo(int id);
};
#endif