48 lines
965 B
C++
48 lines
965 B
C++
#pragma once
|
|
#include <SDL2/SDL.h>
|
|
#include "common/screen.h"
|
|
#include "common/utils.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#ifndef CHEEVOS_H
|
|
#define CHEEVOS_H
|
|
|
|
struct cheevos_t
|
|
{
|
|
int id; // Identificador del logro
|
|
std::string caption; // Texto con el nombre del logro
|
|
std::string description; // Texto que describe el logro
|
|
bool completed; // Indica si se ha obtenido el logro
|
|
bool valid; // Indica si se puede obtener el logro
|
|
};
|
|
|
|
class Cheevos
|
|
{
|
|
private:
|
|
// Punteros y objetos
|
|
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(Screen *screen, options_t *options);
|
|
|
|
// Destructor
|
|
~Cheevos();
|
|
|
|
// Desbloquea un logro
|
|
void unlockCheevo(int id);
|
|
};
|
|
|
|
#endif
|