forked from jaildesigner-jailgames/jaildoctors_dilemma
Empezando a trabajar con los logros
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user