2021-12-22 16:42:26 +01:00

56 lines
1.2 KiB
C++

#pragma once
#include <memory>
#include "KTexture.h"
#include <vector>
#include <SDL_render.h>
#include "KFont.h"
#include "KInput.h"
#include "KSettings.h"
#include "Utils.h"
namespace KapitanGame {
class KExit;
class KObject;
class KGame
{
public:
KGame();
~KGame();
KGame(const KGame& other) = delete;
KGame(KGame&& other) noexcept = delete;
KGame& operator=(const KGame& other) = delete;
KGame& operator=(KGame&& other) noexcept = delete;
int Run(int argc, char* args[]);
private:
SDL_Window* Window = nullptr;
SDL_Renderer* Renderer = nullptr;
std::unordered_map<std::pair<int, int>, std::shared_ptr<KObject>, Utils::PairHash> Objects;
std::vector<std::shared_ptr<KPawn>> Pawns;
std::vector<std::shared_ptr<KPlayerController>> PlayerControllers;
std::unordered_map<std::string, KTexture> Textures;
std::unordered_map<std::string, KFont> Fonts;
KInput Input;
uint32_t Time;
uint32_t PreviousTime;
SDL_FRect Map;
std::weak_ptr<KObject> Exit;
KSettings Settings;
bool SettingsTextTextureDirty = true;
bool LoadLevel();
bool LoadMedia();
int LvlCounter = 1;
bool Playing = true;
uint32_t RestartTick = -1;
};
}