Primer commit. Clon del repo de CC
This commit is contained in:
70
source/instructions.h
Normal file
70
source/instructions.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "common/asset.h"
|
||||
#include "common/input.h"
|
||||
#include "common/jail_audio.h"
|
||||
#include "common/screen.h"
|
||||
#include "common/sprite.h"
|
||||
#include "common/text.h"
|
||||
#include "common/utils.h"
|
||||
#include "const.h"
|
||||
|
||||
#ifndef INSTRUCTIONS_H
|
||||
#define INSTRUCTIONS_H
|
||||
|
||||
enum mode_e
|
||||
{
|
||||
m_manual,
|
||||
m_auto
|
||||
};
|
||||
|
||||
// Clase Instructions
|
||||
class Instructions
|
||||
{
|
||||
private:
|
||||
// Objetos y punteros
|
||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||
Screen *screen; // Objeto encargado de dibujar en pantalla
|
||||
std::vector<Texture *> itemTextures; // Vector con las texturas de los items
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
SDL_Texture *backbuffer; // Textura para usar como backbuffer
|
||||
Sprite *sprite; // Sprite con la textura de las instrucciones
|
||||
Asset *asset; // Objeto que gestiona todos los ficheros de recursos
|
||||
Input *input; // Objeto pata gestionar la entrada
|
||||
Lang *lang; // Objeto para gestionar los textos en diferentes idiomas
|
||||
Text *text; // Objeto para escribir texto
|
||||
section_t *section; // Estado del bucle principal para saber si continua o se sale
|
||||
|
||||
// Variables
|
||||
Uint16 counter; // Contador
|
||||
Uint16 counterEnd; // Valor final para el contador
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
Uint32 ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
bool manualQuit; // Indica si se quiere salir del modo manual
|
||||
mode_e mode; // Modo en el que se van a ejecutar las instrucciones
|
||||
|
||||
// Actualiza las variables
|
||||
void update();
|
||||
|
||||
// Pinta en pantalla
|
||||
void render();
|
||||
|
||||
// Comprueba los eventos
|
||||
void checkEvents();
|
||||
|
||||
// Comprueba las entradas
|
||||
void checkInput();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Instructions(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, Lang *lang, section_t *section);
|
||||
|
||||
// Destructor
|
||||
~Instructions();
|
||||
|
||||
// Bucle principal
|
||||
void run(mode_e mode);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user