47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "utils.h"
|
|
#include "asset.h"
|
|
#include "enemy.h"
|
|
#include "enemy_path.h"
|
|
#include "map.h"
|
|
#include "player.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#ifndef ENEMY_ENGINE_H
|
|
#define ENEMY_ENGINE_H
|
|
|
|
// Clase EnemyEngine
|
|
class EnemyEngine
|
|
{
|
|
private:
|
|
SDL_Renderer *renderer; // El renderizador de la ventana
|
|
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
|
|
Map *map; // Mapa con la información de la habitación
|
|
Player *player; // Puntero con el jugador
|
|
std::vector<EnemyPath *> enemies; // Vector con la lista de enemigos
|
|
|
|
// Carga las variables desde un fichero
|
|
bool load(std::string file_path);
|
|
|
|
// Asigna variables a una estructura enemy_t
|
|
bool setEnemy(enemy_t *enemy, SDL_Point *p1, SDL_Point *p2, std::string var, std::string value);
|
|
|
|
public:
|
|
// Constructor
|
|
EnemyEngine(SDL_Renderer *renderer, Asset *asset, Player *player, Map *map, std::string file);
|
|
|
|
// Destructor
|
|
~EnemyEngine();
|
|
|
|
// Pinta los enemigos en pantalla
|
|
void render();
|
|
|
|
// Actualiza las variables del objeto
|
|
void update();
|
|
};
|
|
|
|
#endif
|