0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 13:43:41 +00:00
Benedikt Galbavy 6a2e8289f6 fixed memory leaks
managers are no singletons anymore
2024-01-30 15:17:58 +01:00

48 lines
971 B
C++

#pragma once
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <vector>
#include "Vector2D.h"
class AssetManager;
class CollisionHandler;
class TextureManager;
class SoundManager;
enum class TeamLabel;
class Game
{
public:
Game();
~Game();
void init(const char* title, int xpos, int ypos, int width, int height, bool fullscreen);
void selectCharacters(const char* &playerSprite, const char* &enemySprite);
void handleEvents();
void update();
void render();
void clean();
bool running() const;
static void addTile(unsigned long id, int x, int y);
static SDL_Renderer* renderer;
static SDL_Event event;
static CollisionHandler* collisionHandler;
static AssetManager* assets;
static TextureManager* textureManager;
static SoundManager* soundManager;
private:
void setWinner(TeamLabel winningTeam);
TeamLabel getWinner();
int counter = 0;
bool isRunning = false;
SDL_Window* window;
TeamLabel winner;
};