#ifndef GAME_H_E6F1396E #define GAME_H_E6F1396E #include #include #include #include #include #include #include #include #include "sprite.h" #include "map.h" #include "consts.h" #include "system.h" #include "mixer.h" #include "font.h" class Renderer; class Game { public: Game(Renderer& renderer, std::mt19937& rng) : font_("../res/font.txt", renderer), rng_(&rng) {} Mixer& getMixer() { return mixer_; } bool shouldQuit() const { return shouldQuit_; } void quit() { shouldQuit_ = true; } template void emplaceSystem() { systems_.push_back(std::make_unique(*this)); systemByKey_[T::Key] = systems_.back().get(); } template T& getSystem() { return *dynamic_cast(systemByKey_.at(T::Key)); } auto systems() { return systems_ | ranges::views::transform([&] (std::unique_ptr& systemPtr) -> System& { return *systemPtr; }); } int emplaceSprite(std::string alias); void destroySprite(int id); const Sprite& getSprite(int id) const { return sprites_.at(id); } Sprite& getSprite(int id) { return sprites_.at(id); } const std::set& getSprites() { return spriteIds_; } int getSpriteByAlias(std::string alias) const { return spritesByAlias_.at(alias); } auto spriteView() const { return ranges::views::transform([&] (int id) -> const Sprite& { return sprites_.at(id); }); } auto spriteView() { return ranges::views::transform([&] (int id) -> Sprite& { return sprites_.at(id); }); } void loadMap(std::string filename); const Map& getMap() const { return *map_; } const Font& getFont() const { return font_; } std::mt19937& getRng() { return *rng_; } void pauseGameplay() { paused_ = true; } void unpauseGameplay() { paused_ = false; } bool isGameplayPaused() const { return paused_; } private: Mixer mixer_; bool shouldQuit_ = false; std::list> systems_; std::map systemByKey_; std::set spriteIds_; std::deque idsToReuse_; std::vector sprites_; std::map spritesByAlias_; std::unique_ptr map_; Font font_; std::mt19937* rng_; bool paused_ = false; }; #endif /* end of include guard: GAME_H_E6F1396E */ ='right' method='get' action='/lingo2-archipelago/log/data/maps/the_entry/rooms/Eye%20Room.txtpb'>
blob: 50781addd5640469839e6b25f68234c77537d53d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: "Eye Room"
display_name: "Eye Room"
panels {
  name: "I"
  path: "Panels/Entry/eyes_1"
  clue: "i"
  answer: "eyes"
  symbols: "zero"
  symbols: "planet"
}
paintings {
  name: "ENTER"
  path: "Components/Paintings/eyes2"
  orientation: "south"
  display_name: "Black Wall Painting"
}
paintings {
  name: "EXIT"
  path: "Components/Paintings/eyes4"
  orientation: "west"
  display_name: "Beige Wall Painting"
}
paintings {
  name: "GALLERY"
  path: "Components/Paintings/eyes5"
  orientation: "east"
  move: true
  enter_only: true
  required_door { name: "Third Eye Painting" }
  display_name: "Painting Beside Panel"
}