gba-sprite-engine/src/engine/Scene.h

42 lines
1.0 KiB
C
Raw Normal View History

2018-08-01 16:03:16 +02:00
//
// Created by Wouter Groeneveld on 28/07/18.
//
#ifndef GBA_SPRITE_ENGINE_SCRENE_H
#define GBA_SPRITE_ENGINE_SCRENE_H
#include <vector>
#include <functional>
2018-08-01 16:03:16 +02:00
#include <engine/background/background.h>
#include "engine/sprites/sprite.h"
#include "palette_manager.h"
2018-08-01 16:03:16 +02:00
class GBAEngine;
2018-08-01 16:03:16 +02:00
class Scene {
protected:
std::unique_ptr<ForegroundPaletteManager> foregroundPalette;
std::unique_ptr<BackgroundPaletteManager> backgroundPalette;
GBAEngine* engine;
2018-08-01 16:03:16 +02:00
public:
ForegroundPaletteManager* getForegroundPalette() { return foregroundPalette.get(); }
BackgroundPaletteManager* getBackgroundPalette() { return backgroundPalette.get(); }
2018-08-01 16:03:16 +02:00
// bg music in here
virtual std::vector<Sprite*> sprites() = 0;
virtual std::vector<Background*> backgrounds() = 0;
virtual void load() = 0;
virtual void tick(u16 i) = 0;
void setEngineForSceneSwitching(GBAEngine* engine);
2018-08-01 16:03:16 +02:00
Scene() { }
~Scene() {
// scenes should manage their own resources - use std::unique_ptr
}
};
#endif //GBA_SPRITE_ENGINE_SCRENE_H