#pragma once #include #include #include #include #include #include "Manager.h" #include "Vector2D.h" #include "Entity.h" typedef std::function gamefunction; class AssetManager; class CollisionHandler; class TextureManager; class SoundManager; class Map; class Game; class GameInternal { public: GameInternal(); ~GameInternal(); 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 isRunning() const; void setRunning(bool running); /* static */ SDL_Renderer* renderer = nullptr; /* static */ SDL_Event event; /* static */ CollisionHandler* collisionHandler; /* static */ AssetManager* assets; /* static */ TextureManager* textureManager; /* static */ SoundManager* soundManager; // moved globals Manager manager; Map* map; // game specific, might not be needed for all types of games std::vector& tiles; std::vector& players; std::vector& projectiles; std::vector& hearts; std::vector& powerups; // end moved globals void refreshPlayers(); Entity::TeamLabel getWinner() const; void setWinner(Entity::TeamLabel winningTeam); private: Game* gameInstance; int counter = 0; bool running = false; SDL_Window* window; Entity::TeamLabel winner; };